plot_fit

sherpa.ui.plot_fit(id=None, **kwargs)

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

This function creates a plot containing the data and the model (including any instrument response) for a data set.

Parameters:
  • id (int or str, optional) – The data set. If not given then the default identifier is used, as returned by get_default_id.
  • replot (bool, optional) – Set to True to use the values calculated by the last call to plot_fit. The default is False.
  • overplot (bool, optional) – If True then add the data to an exsiting plot, otherwise create a new plot. The default is False.
Raises:

sherpa.utils.err.IdentifierErr – If the data set does not exist or a source expression has not been set.

See also

get_fit_plot()
Return the data used by plot_fit.
get_default_id()
Return the default data set identifier.
plot()
Create one or more plot types.
plot_fit_delchi()
Plot the fit results, and the residuals, for a data set.
plot_fit_resid()
Plot the fit results, and the residuals, for a data set.
plot_data()
Plot the data values.
plot_model()
Plot the model for a data set.
set_xlinear()
New plots will display a linear X axis.
set_xlog()
New plots will display a logarithmically-scaled X axis.
set_ylinear()
New plots will display a linear Y axis.
set_ylog()
New plots will display a logarithmically-scaled Y axis.

Examples

Plot the fit results for the default data set:

>>> plot_fit()

Overplot the ‘core’ results on those from the ‘jet’ data set, using a logarithmic scale for the X axis:

>>> set_xlog()
>>> plot_fit('jet')
>>> plot_fit('core', overplot=True)