ResidPlot

class sherpa.plot.ResidPlot[source] [edit on github]

Bases: BaseResidualPlot

Create plots of the residuals (data - model) per point.

The value of (data-model) is plotted for each point.

x

The X value for each point.

Type:

array_like

y

The Y value for each point: data - model.

Type:

array_like

xerr

The half-width of each X “bin”, if set.

Type:

array_like

yerr

The error on the Y value, if set.

Type:

array_like

xlabel, ylabel, title

Plot labels.

Type:

str

Notes

The ylog setting is ignored, whether given as a preference or a keyword argument, so the Y axis is always drawn with a linear scale.

Attributes Summary

plot_prefs

The preferences for the plot.

residual_axis

At what point on the y axis is the residual line drawn.

residual_color

The color of the residual line.

residual_lw

The line width of the residual line.

Methods Summary

hline(y[, xmin, xmax, linecolor, linestyle, ...])

Draw a line at constant y, extending over the plot.

overplot(*args, **kwargs)

Add the data to an existing plot.

plot([overplot, clearwindow])

Plot the data.

prepare(data, model, stat)

Create the data to plot

vline(x[, ymin, ymax, linecolor, linestyle, ...])

Draw a line at constant x, extending over the plot.

Attributes Documentation

plot_prefs = {'alpha': None, 'capsize': 0, 'color': None, 'ecolor': None, 'label': None, 'linestyle': 'None', 'linewidth': None, 'marker': '.', 'markerfacecolor': None, 'markersize': None, 'xerrorbars': True, 'xlog': False, 'yerrorbars': True, 'ylog': False}

The preferences for the plot.

residual_axis: float = 0

At what point on the y axis is the residual line drawn.

residual_color: str = 'k'

The color of the residual line.

residual_lw: float = 0.8

The line width of the residual line.

Methods Documentation

static hline(y, xmin=0, xmax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True) [edit on github]

Draw a line at constant y, extending over the plot.

overplot(*args, **kwargs) [edit on github]

Add the data to an existing plot.

This is the same as calling the plot method with overplot set to True.

See also

plot

plot(overplot: bool = False, clearwindow: bool = True, **kwargs) None [edit on github]

Plot the data.

This will plot the data sent to the prepare method.

Parameters:
  • overplot (bool, optional) – If True then add the data to an existing plot, otherwise create a new plot.

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

  • **kwargs – These values are passed on to the plot backend, and must match the names of the keys of the object’s plot_prefs dictionary.

See also

prepare, overplot

prepare(data: Data1D, model: Model, stat: Stat) None [edit on github]

Create the data to plot

Parameters:
  • data – The Sherpa data object to display (it is assumed to be one dimensional). This defines the grid over which the model is displayed.

  • model – The Sherpa model expression to evaluate and display.

  • stat (optional) – This parameter is unused.

See also

plot

static vline(x, ymin=0, ymax=1, linecolor=None, linestyle=None, linewidth=None, overplot=False, clearwindow=True) [edit on github]

Draw a line at constant x, extending over the plot.