plot_bkg
- sherpa.astro.ui.plot_bkg(id: IdType | None = None, bkg_id: IdType | None = None, replot=False, overplot=False, clearwindow=True, **kwargs) None
Plot the background values for a PHA data set.
- Parameters:
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.bkg_id (int, str, or None, optional) – Identify the background component to use, if there are multiple ones associated with the data set.
replot (bool, optional) – Set to
Trueto use the values calculated by the last call toplot_bkg. The default isFalse.overplot (bool, optional) – If
Truethen add the data to an existing 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)?
- Raises:
sherpa.utils.err.ArgumentErr – If the data set does not contain PHA data.
sherpa.utils.err.IdentifierErr – If the
bkg_idparameter is invalid.
See also
get_bkg_plotReturn the data used by plot_bkg.
get_default_idReturn the default data set identifier.
plotCreate one or more plot types.
set_analysisSet the units used when fitting and displaying spectral data.
set_xlinearNew plots will display a linear X axis.
set_xlogNew plots will display a logarithmically-scaled X axis.
set_ylinearNew plots will display a linear Y axis.
set_ylogNew plots will display a logarithmically-scaled Y axis.
Examples
Plot the background from the default data set:
>>> plot_bkg()
Overplot the background from the ‘jet’ data set on the data. There is no scaling for differences in aperture or exposure time:
>>> plot_data('jet') >>> plot_bkg('jet', overplot=True)
Compare the first two background components of data set 1:
>>> plot_bkg(1, 1) >>> plot_bkg(1, 2, overplot=True)