plot_source¶
-
sherpa.ui.
plot_source
(id=None, replot=False, overplot=False, clearwindow=True, **kwargs)¶ Plot the source expression for a data set.
This function plots the source model for a data set. This does not include any instrument response (e.g. a convolution created by set_psf).
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.
- replot (bool, optional) – Set to
True
to use the values calculated by the last call to plot_source. The default isFalse
. - overplot (bool, optional) – If
True
then add the data to an exsiting plot, otherwise create a new plot. The default isFalse
. - clearwindow (bool, optional) – Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?
See also
get_source_plot()
- Return the data used to create the source plot.
get_default_id()
- Return the default data set identifier.
plot()
- Create one or more plot types.
plot_model()
- Plot the model for a data set.
plot_source_component()
- Plot a component of 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 additional arguments supported by plot_source are the same as the keywords of the dictionary returned by get_model_plot_prefs.
Examples
Plot the unconvolved source model for the default data set:
>>> plot_source()
Overplot the source model for data set 2 on data set 1:
>>> plot_source(1) >>> plot_source(2, 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 source using a log scale for both axes, and then overplots the source from data set “jet” using a dashed line:
>>> plot_source(xlog=True, ylog=True) >>> plot_source('jet', overplot=True, linestyle='dashed')