Histogramming tools

coffea.hist is a histogram filling, transformation, and plotting sub-package, utilizing numpy arrays for storage and matplotlib plotting routines for visualization.

Features found in this package are similar to those found in packages such as histbook (deprecated), boost-histogram (in development), physt, and built-in numpy histogram utilities.


poisson_interval(sumw, sumw2[, coverage])

Frequentist coverage interval for Poisson-distributed observations

clopper_pearson_interval(num, denom[, coverage])

Compute Clopper-Pearson coverage interval for a binomial distribution

normal_interval(pw, tw, pw2, tw2[, coverage])

Compute errors based on the expansion of pass/(pass + fail), possibly weighted

plot1d(hist[, ax, clear, overlay, stack, ...])

Create a 1D plot from a 1D or 2D Hist object

plotratio(num, denom[, ax, clear, overflow, ...])

Create a ratio plot, dividing two compatible histograms

plot2d(hist, xaxis[, ax, clear, xoverflow, ...])

Create a 2D plot from a 2D Hist object

plotgrid(h[, figure, row, col, overlay, ...])

Create a grid of plots, enumerating identifiers on up to 3 axes


Export a 1-dimensional Hist object to uproot


Hist(label, *axes, **kwargs)

Specify a multidimensional histogram.

Bin(name, label, n_or_arr[, lo, hi])

A binned axis with name, label, and binning.

Interval(lo, hi[, label])

Real number interval

Cat(name, label[, sorting])

A category axis with name and label

StringBin(name[, label])

A string used to fill a sparse axis

Class Inheritance Diagram

Inheritance diagram of coffea.hist.hist_tools.Hist, coffea.hist.hist_tools.Bin, coffea.hist.hist_tools.Interval, coffea.hist.hist_tools.Cat, coffea.hist.hist_tools.StringBin