FluxHistogram

class sherpa.astro.plot.FluxHistogram[source] [edit on github]

Bases: ModelHistogram

Derived class for creating 1D flux distribution plots

Attributes Summary

histo_prefs

The preferences for the plot.

x

Return (xlo + xhi) / 2

Methods Summary

overplot(*args, **kwargs)

plot([overplot, clearwindow])

Plot the data.

prepare(fluxes, bins)

Define the histogram plot.

Attributes Documentation

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

The preferences for the plot.

x

Return (xlo + xhi) / 2

This is intended to make it easier to swap between plot- and histogram-style plots by providing access to an X value.

Methods Documentation

overplot(*args, **kwargs) [edit on github]
plot(overplot=False, clearwindow=True, **kwargs) [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(fluxes, bins)[source] [edit on github]

Define the histogram plot.

Parameters:
  • fluxes (numpy array) – The data, stored in a niter by (npar + 2) matrix, where each row is an iteration, the first column is the flux for that row, the next npar columns are the parameter values, and the last column indicates whether the row was clipped (1) or not (0).

  • bins (int) – The number of bins to split the flux data into.