plot_bkg_fit
- sherpa.astro.ui.plot_bkg_fit(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 (data, model) for the background of a PHA 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.
- Parameters:
id (int, 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.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_fit. 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.sherpa.utils.err.ModelErr – If no model expression has been created for the background data.
See also
get_bkg_fit_plotReturn the data used by plot_bkg_fit.
plotCreate one or more plot types.
plot_bkgPlot the background values for a PHA data set.
plot_bkg_modelPlot the model for the background of a PHA data set.
plot_bkg_fit_delchiPlot the fit results, and the residuals, for the background of a PHA data set.
plot_bkg_fit_ratioPlot the fit results, and the data/model ratio, for the background of a PHA data set.
plot_bkg_fit_residPlot the fit results, and the residuals, for the background of a PHA data set.
plot_fitPlot the fit results (data, model) for a data set.
set_analysisSet the units used when fitting and displaying spectral data.
Examples
Plot the background fit to the default data set:
>>> plot_bkg_fit()