# plot_source_component¶

sherpa.astro.ui.plot_source_component(id, model=None, replot=False, overplot=False, clearwindow=True, **kwargs)

Plot a component of the source expression for a data set.

This function evaluates and plots a component of the model expression for a data set, without any instrument response. Use plot_model_component to include any response.

Parameters
• id (int or str, optional) – The data set that provides the data. If not given then the default identifier is used, as returned by get_default_id.

• model (str or sherpa.models.model.Model instance) – The component to display (the name, if a string).

• replot (bool, optional) – Set to True to use the values calculated by the last call to plot_source_component. The default is False.

• overplot (bool, optional) – If True then add the data to an exsiting 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)?

get_source_component_plot()

Return the data used by plot_source_component.

get_default_id()

Return the default data set identifier.

plot()

Create one or more plot types.

plot_model_component()

Plot a component of the model for a data set.

plot_source()

Plot the source expression for a data set.

set_xlinear()

New plots will display a linear X axis.

set_xlog()

New plots will display a logarithmically-scaled X axis.

set_ylinear()

New plots will display a linear Y axis.

set_ylog()

New plots will display a logarithmically-scaled Y axis.

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.

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

Examples

Overplot the pl component of the source expression for the default data set:

>>> plot_source()
>>> plot_source_component(pl, overplot=True)