plot_bkg_resid
- sherpa.astro.ui.plot_bkg_resid(id: IdType | None = None, bkg_id: IdType | None = None, replot=False, overplot=False, clearwindow=True, **kwargs) None
Plot the residual (data-model) values for the background of a PHA data set.
Display the residuals for the background of a PHA data set when it is being fit, rather than subtracted from the source.
Changed in version 4.12.0: The Y axis is now always drawn using a linear scale.
- 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
True
to use the values calculated by the last call toplot_bkg_resid
. The default isFalse
.overplot (bool, optional) – If
True
then 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_id
parameter is invalid.sherpa.utils.err.ModelErr – If no model expression has been created for the background data.
See also
get_bkg_resid_plot
Return the data used by plot_bkg_resid.
plot_bkg_chisqr
Plot the chi-squared value for each point of the background of a PHA data set.
plot_bkg_delchi
Plot the ratio of residuals to error for the background of a PHA data set.
plot_bkg_ratio
Plot the ratio of data to model values for the background of a PHA data set.
set_bkg_model
Set the background model expression for a PHA data set.
Notes
The ylog setting is ignored, and the Y axis is drawn using a linear scale.
Examples
>>> plot_bkg_resid()
>>> plot_bkg('jet') >>> plot_bkg_resid('jet', bkg_id=1, overplot=True) >>> plot_bkg_resid('jet', bkg_id=2, overplot=True)