sherpa.astro.ui.plot_delchi(id=None, replot=False, overplot=False, clearwindow=True, **kwargs)

Plot the ratio of residuals to error for a data set.

This function displays the residuals (data - model) divided by the error, for a data set.

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

  • 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_delchi. The default is False.

  • overplot (bool, optional) – If True then add the data to an existing plot, otherwise create a new plot. The default is False.

  • clearwindow (bool, optional) – Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?


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

See also


Return the data used by plot_delchi.


Return the default data set identifier.


Create one or more plot types.


Plot the chi-squared value for each point in a data set.


Plot the ratio of data to model for a data set.


Plot the residuals (data - model) for a data set.


New plots will display a linear X axis.


New plots will display a logarithmically-scaled X axis.


The additional arguments supported by plot_delchi are the same as the keywords of the dictionary returned by get_data_plot_prefs.

The ylog setting is ignored, and the Y axis is drawn using a linear scale.


Plot the residuals for the default data set, divided by the error value for each bin:

>>> plot_delchi()

Overplot the values from the ‘core’ data set on those from the ‘jet’ dataset:

>>> plot_delchi('jet')
>>> plot_delchi('core', overplot=True)

Additional arguments can be given that are passed to the plot backend: the supported arguments match the keywords of the dictionary returned by get_data_plot_prefs. The following sets error bars to be orange and the marker to be a circle (larger than the default one):

>>> plot_delchi(ecolor='orange', marker='o')