    Return the data used to create the model-component plot.

get_model_component_plot(id, model=None, recalc=True)
id - int or str, optional
model - str or sherpa.models.model.Model instance
recalc - bool, optional

For PHA data, the response model is automatically added by the routine unless the model contains a response.

Return the plot data for the pl component used in the default data set:

>>> cplot = get_model_component_plot(pl)

Return the full source model ( fplot ) and then for the components gal * pl and gal * gline , for the data set 'jet':

>>> fmodel = xsphabs.gal * (powlaw1d.pl + gauss1d.gline) >>> set_source('jet', fmodel) >>> fit('jet') >>> fplot = get_model_plot('jet') >>> plot1 = get_model_component_plot('jet', pl*gal) >>> plot2 = get_model_component_plot('jet', gline*gal)

For PHA data sets the response is automatically added, but it can also be manually specified. In the following plot1 and plot2 contain the same data:

>>> plot1 = get_model_component_plot(pl) >>> rsp = get_response() >>> plot2 = get_model_component_plot(rsp(pl))

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` .
model
The component to use (the name, if a string).
recalc
If False then the results from the last call to

`plot_model_component` (or `get_model_component_plot` ) are returned, otherwise the data is re-generated.

The return value from this function is:

An object representing the data used to create the plot by

`plot_model_component` . The return value depends on the data set (e.g. PHA, 1D binned, or 1D un-binned).

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the `model` parameter. If given two un-named arguments, then they are interpreted as the `id` and `model` parameters, respectively.

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

December 2023