BinningPlotter

class remu.plotting.BinningPlotter(binning, marginalize_subbinnings=False, **kwargs)[source]

Bases: remu.plotting.ArrayPlotter

Plotting class for the simplest Binning class.

Parameters
binningBinning

The binning to be plotted.

marginalize_subbinningsbool, optional

Plot the contents of subbinnings as a single bin.

**kwargsoptional

Addittional keyword arguments are passed to ArrayPlotter.

Attributes

figax

((Figure, [[Axes, …], …])) The figure and axes that are used for the plotting.

color

(cycle of str) Cycler that determines the color of plotting commands.

hatch

(cycle of str) Cycler that determines the hatching style of plotting commands.

binning

(Binning) The binning defining what will be plotted.

marginalize_subbinnings

(bool) Whether or not subbinnings will be marginalized before plotting.

Methods

get_axis_label()

Return the default label for the axis.

get_bin_edges(i_min, i_max)

Get the bin edges corresponding to bins i_min to i_max.

legend(**kwargs)

Draw a legend in the first axis.

plot_array([array, density, stack_function, ...])

Plot an array.

plot_entries([binning])

Plot the entries of a Binning.

plot_sumw2([binning])

Plot the sumw2 of a Binning.

plot_values([binning])

Plot the values of a Binning.

savefig(*args, **kwargs)

Save the figure.

subplots(*args, **kwargs)

Return the (Figure, Axes) tuple of the binning.

get_axis_label()

Return the default label for the axis.

get_bin_edges(i_min, i_max)

Get the bin edges corresponding to bins i_min to i_max.

legend(**kwargs)

Draw a legend in the first axis.

plot_array(array=None, density=False, stack_function=<function mean>, margin_function=None, **kwargs)

Plot an array.

Parameters
arrayndarray

The thing to plot.

densitybool, optional

Divide the data by the relative bin width: width / total_plot_range.

stack_functionfloat or function or (lower_function, function)

How to deal with multiple arrays. When float, plot the respective quantile as equal-tailed interval. When function, apply this function to the stack after marginalisation. When (function, function), use these functions to calculate lower and upper bounds of the area to be plotted respectively. Functions must accept axis keyword argument.

plot_entries(binning=None, **kwargs)[source]

Plot the entries of a Binning.

plot_sumw2(binning=None, **kwargs)[source]

Plot the sumw2 of a Binning.

plot_values(binning=None, **kwargs)[source]

Plot the values of a Binning.

savefig(*args, **kwargs)

Save the figure.

subplots(*args, **kwargs)

Return the (Figure, Axes) tuple of the binning.

Creates one using Matplotlib’s subplots, if necessary.