    Plot the model for a data set.

plot_model(id=None, replot=False, overplot=False, clearwindow=True, **kwargs)
id - int or str, optional
replot - bool, optional
overplot - bool, optional
clearwindow - bool, optional

This function plots the model for a data set, which includes any instrument response (e.g. a convolution created by

`set_psf` ).

Plot the convolved source model for the default data set:

>>> plot_model()

Overplot the model for data set 2 on data set 1:

>>> plot_model(1) >>> plot_model(2, overplot=True)

Create the equivalent of plot_fit('jet') :

>>> plot_data('jet') >>> plot_model('jet', overplot=True)

Additional arguments can be given that are passed to the plot backend: the supported arguments match the keywords of the dictionary returned by `get_model_plot_prefs` . The following plots the model using a log scale for both axes, and then overplots the model from data set 2 using a dashed line and slightly transparent:

>>> plot_model(xlog=True, ylog=True) >>> plot_model(2, overplot=True, alpha=0.7, linestyle='dashed')

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The data set that provides the data. If not given then the default identifier is used, as returned by `get_default_id` .
replot
Set to True to use the values calculated by the last call to `plot_model` . The default is False .
overplot
If True then add the data to an existing plot, otherwise create a new plot. The default is False .
clearwindow
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_model` are the same as the keywords of the dictionary returned by `get_model_plot_prefs` .

For PHA data sets the model plot created by `plot_model` differs to the model plot created by `plot_fit` : the fit version uses the grouping of the data set whereas the `plot_model` version shows the ungrouped data (that is, it uses the instrumental grid). The filters used are the same in both cases.

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

December 2023