Histogram stack

A collection of histograms. The total summed histogram and its variations may be accessed easily, and the stack may be plotted conveniently.

class heppy.histostack(histograms, attributes={})

Stack of one-dimensional histograms

Parameters:
  • histograms (list of heppy.histogram1d) – histograms in the stack
  • attributes (dict) – dictionary of completely arbitrary attributes that the user can provide/change/access. E.g. information on how to plot
total
Returns:heppy.histogram1d that is the combination of all the stacked ones, with the combined uncertainty. If the stack has no histograms, returns None
iterbands()

Bands are 3-tuples of (curve representation) x-values as well as two subsequent curves that are useful as arguments to plt.fill_between(). E.g.:

for histogram, band in zip(stack.histograms, stack.iterbands()):
    ax.fill_between(*band, **histogram.attributes)

The bands are ordered such that the first histogram in the stack is at the top and the last at the bottom