Confidence1D

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

Bases: DataPlot

The base class for 1D confidence plots.

Changed in version 4.16.1: Handling of log-scaled axes and use of the delv argument has been improved, and the string output now includes the parameter value (if available).

Attributes Summary

conf_type

The type of confidence analysis.

plot_prefs

The preferences for the plot.

Methods Summary

calc(fit, par)

Evaluate the statistic for the parameter range.

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([min, max, nloop, delv, fac, log, ...])

Set the data to plot.

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

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

Attributes Documentation

conf_type = 'unknown'

The type of confidence analysis.

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

The preferences for the plot.

Methods Documentation

calc(fit, par)[source] [edit on github]

Evaluate the statistic for the parameter range.

This requires prepare to have been called, and must be called before plot is called.

Parameters:
  • fit – The Sherpa fit instance to use (defines the statistic and optimiser to use).

  • par – The parameter to iterate over.

See also

plot, prepare

Notes

This method is assumed to be over-ridden in derived classes, where it will perform the statistic calculations needed to create the visualization. This version should be called from these classes as it validates the fit and par arguments.

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=False, clearwindow=True, **kwargs)[source] [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(min=None, max=None, nloop=20, delv=None, fac=1, log=False, numcores=None)[source] [edit on github]

Set the data to plot.

This defines the range over which the statistic will be calculated, but does not perform the evaluation.

Parameters:
  • min (number or None, optional) – The minimum and maximum parameter value to used. If either is not set then the range is calculated using the fac parameter.

  • max (number or None, optional) – The minimum and maximum parameter value to used. If either is not set then the range is calculated using the fac parameter.

  • nloop (int, optional) – The number of points at which to evaluate the statistic. It must be greater than 1. This is used when delv is set to None.

  • delv (number or None, optional) – The spacing of the parameter grid. This takes precedence over nloop.

  • fac (number, optional) – Used when either min or max are not set. The parameter range in this case is taken to be fac times the separation of the covariance limits for the parameter (unless explicitly given).

  • log (bool, optional) – Should the parameter be evaluated on a logarithmically-spaced grid rather than a linearly-spaced one?

  • numcores (int or None, optional) – Should the parameter evaluation use multiple CPU cores if available?

See also

calc

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.