plot_bkg_fit_delchi

sherpa.astro.ui.plot_bkg_fit_delchi(id: IdType | IdTypes | None = None, bkg_id: IdType | None = None, replot: bool = False, overplot: bool = False, clearwindow: bool = True, **kwargs) → None

Plot the fit results, and the residuals, for the background of a PHA data set.

This creates two plots - the first from plot_bkg_fit and the second from plot_bkg_delchi - for a data set.

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.

Changed in version 4.12.2: The overplot option now works.

Changed in version 4.12.0: The Y axis of the residual plot is now always drawn using a linear scale.

Parameters:
idint, 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_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_fit_delchi. 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_fit_plot

Return the data used by plot_bkg_fit.

get_bkg_delchi_plot

Return the data used by plot_bkg_delchi.

plot

Create one or more plot types.

plot_bkg

Plot the background values for a PHA data set.

plot_bkg_model

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

plot_bkg_fit

Plot the fit results (data, model) for the background of a PHA data set.

plot_bkg_fit_ratio

Plot the fit results, and the data/model ratio, for the background of a PHA data set.

plot_bkg_fit_resid

Plot the fit results, and the residuals, for the background of a PHA data set.

plot_fit

Plot the fit results (data, model) for a data set.

plot_fit_delchi

Plot the fit results, and the residuals, for a data set.

set_analysis

Set the units used when fitting and displaying spectral data.

Notes

For the residual plot, the ylog setting is ignored, and the Y axis is drawn using a linear scale.

Examples

Plot the background fit and residuals (normalised by the error) to the default data set:

>>> plot_bkg_fit_delchi()