plot_bkg_source

sherpa.astro.ui.plot_bkg_source(id: IdType | IdTypes | None = None, lo: float | None = None, hi: float | None = None, bkg_id: IdType | None = None, replot: bool = False, overplot: bool = False, clearwindow: bool = True, **kwargs) None

Plot the model expression for the background of a PHA data set.

This function plots the model for the background of a PHA data set. It does not include the instrument response (the ARF and RMF).

Changed in version 4.18.0: Multiple data sets can be displayed by using a list of identifiers. Per-plot options can now be given by using a list of values.

Parameters:
idint, str, sequence of int or 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.

lonumber, optional

The low value to plot.

hinumber, optional

The high value to plot.

bkg_idint, str, or None, optional

Identify the background component to use, if there are multiple ones associated with the data set.

replotbool, optional

Set to True to use the values calculated by the last call to plot_bkg_model. The default is False.

overplotbool, optional

If True then add the data to an existing plot, otherwise create a new plot. The default is False.

clearwindowbool, 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_id parameter is invalid.

sherpa.utils.err.ModelErr

If no model expression has been created for the background data.

See also

get_bkg_source_plot

Return the data used by plot_bkg_source.

plot_bkg_model

Plot the model for the background of a PHA data set.

set_bkg_model

Set the background model expression for a PHA data set.

Examples

>>> plot_bkg_source()
>>> plot_bkg_source('jet', bkg_id=1)
>>> plot_bkg_source('jet', bkg_id=2, overplot=True)