    Return the data used by plot_bkg_source.

get_bkg_source_plot(id=None, lo=None, hi=None, bkg_id=None, recalc=True)
id - int or str, optional
lo - number, optional
hi - number, optional
bkg_id - int or str, optional
recalc - bool, optional

Retrieve the source plot information for the background of the default data set and display it:

>>> splot = get_bkg_source_plot() >>> print(splot)

Return the background plot data for data set 2, and then use it to create a plot:

>>> s2 = get_bkg_source_plot(2) >>> s2.plot()

Create a plot of the first two background components of the 'histate' data set, overplotting the second on the first:

>>> b1 = get_bkg_source_plot('histate', bkg_id=1) >>> b2 = get_bkg_source_plot('histate', bkg_id=2) >>> b1.plot() >>> b2.overplot()

Retrieve the background source plots for the 0.5 to 7 range of the 'jet' and 'core' data sets and display them on the same plot:

>>> splot1 = get_bkg_source_plot(id='jet', lo=0.5, hi=7) >>> splot2 = get_bkg_source_plot(id='core', lo=0.5, hi=7) >>> splot1.plot() >>> splot2.overplot()

For a PHA data set, the units on both the X and Y axes of the plot are controlled by the `set_analysis` command. In this case the Y axis will be in units of photons/s/cm^2 and the X axis in keV:

>>> set_analysis('energy', factor=1) >>> splot = get_bkg_source_plot() >>> print(splot)

PARAMETERS

The parameters for this function are:

Parameter
Definition
id
The data set that provides the data. If not given then the default identifier is used, as returned by `get_default_id` .
lo
The low value to plot.
hi
The high value to plot.
bkg_id
Identify the background component to use, if there are multiple ones associated with the data set.
recalc
If False then the results from the last call to

`plot_bkg_source` (or `get_bkg_source_plot` ) are returned, otherwise the data is re-generated.

The return value from this function is:

source -- An object representing the data used to create the plot by

`plot_bkg_source` .

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023