Last modified: December 2024

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

plot_model_components

Context: plotting

Synopsis

Plot all the components of a model.

Syntax

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

Description

Display the individual model components of a source expression.


Examples

Example 1

Display two plots, the first for the `gal * pl` component and the second for `gal * line` :

>>> set_source(xsphabs.gal * (powlaw1d.pl + xsgaussian.line))
>>> plot_model_components(alpha=0.6)

Example 2

Plot the combined model and then overplot the two components in black, partly opaque, and using dotted and dashed line styles:

>>> plot_model(label="combined")
>>> plot_model_components(overplot=True, color="black",
...                       linestyle=["dotted", "dashed"],
...                       label=["model 1", "model 2"],
...                       alpha=0.5)

PARAMETERS

The parameters for this function are:

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

Notes

The additional keyword arguments match the keywords of the dictionary returned by get_model_plot_prefs.

Changes in CIAO

Changed in CIAO 4.17

The keyword arguments can now be set per plot by using a sequence of values.

Added in CIAO 4.17


Bugs

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

See Also

plotting
get_model_components_plot, plot_model_component, plot_source_components