Last modified: December 2024

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/plot_fit_ratio.html
AHELP for CIAO 4.17 Sherpa

plot_fit_ratio

Context: plotting

Synopsis

Plot the fit results, and the ratio of data to model, for a data set.

Syntax

plot_fit_ratio(id=None, replot=False, overplot=False, clearwindow=True,
**kwargs)

Description

This creates two plots - the first from `plot_fit` and the second from `plot_ratio` - for a data set.


Examples

Example 1

Plot the results for the default data set:

>>> plot_fit_ratio()

Example 2

Overplot the 'core' results on those from the 'jet' data set, using a logarithmic scale for the X axis:

>>> set_xlog()
>>> plot_fit_ratio('jet')
>>> plot_fit_ratio('core', overplot=True)

Example 3

Additional arguments can be given that are passed to the plot backend: the supported arguments match the keywords of the dictionary returned by `get_data_plot_prefs` . The following sets the plots to use square symbols (this includes the model as well as data in the top plot) and turns off any line between plots, when using the Matplotlib backend:

>>> plot_fit_ratio(marker='s', linestyle='none')

PARAMETERS

The parameters for this function are:

Parameter Type information Definition
id int, str, or None, optional The data set. If not given then the default identifier is used, as returned by `get_default_id` .
replot bool, optional Set to True to use the values calculated by the last call to `plot_fit_ratio` . The default is False .
overplot bool, optional If True then add the data to an existing plot, otherwise create a new plot. The default is False .
clearwindow bool, optional Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?

Notes

The additional arguments supported by `plot_fit_ratio` are the same as the keywords of the dictionary returned by `get_data_plot_prefs` , and are applied to both plots.

For the ratio plot, the ylog setting is ignored, and the Y axis is drawn using a linear scale.

Changes in CIAO

Changed in CIAO 4.13

The overplot option now works.

Added in CIAO 4.12


Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

plotting
plot_fit, plot_fit_delchi, plot_fit_resid