Synopsis
Plot all the components of a source.
Syntax
plot_source_components(id=None, overplot=False, clearwindow=True, **kwargs)
Description
Display the individual 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_source_components(alpha=0.6)
Example 2
Plot the combined source and then overplot the two components in black, partly opaque, and using dotted and dashed line styles:
>>> plot_source(label="combined") >>> plot_source_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
- plot_model_components, plot_source_component