RectilinearBinningPlotter

class remu.plotting.RectilinearBinningPlotter(binning, x_axis_binnings=None, y_axis_binnings=None, **kwargs)[source]

Bases: remu.plotting.CartesianProductBinningPlotter

Plotting class for RectilinearBinning

Parameters
binningRectilinearBinning

The binning to be plottet

x_axis_binningslist of int/str, optional

The indices of binnings to be plotted on the x-axis.

y_axis_binningslist of int/str, optional

The indices of binnings to be plotted on the y-axis.

**kwargsoptional

Additional keyword arguments are passed to CartesianProductBinningPlotter.

Notes

This plotter does always marginalize the subbinnings.

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

(RectilinearBinning) The binning defining what will be plotted.

marginalize_subbinnings

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

x_axis_binnings

(list of int or str) The indices or variable names of to be plotted on the x-axis.

y_axis_binnings

(list of int or str) The indices or variable names to be plotted on the y-axis.

Methods

get_axis_label(j_binning)

Return variable name.

get_bin_edges(i_min, i_max, j_binning)

Get the finite bin edges.

legend(**kwargs)

Draw a legend in the upper right corner of the plot.

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(j_binning)[source]

Return variable name.

get_bin_edges(i_min, i_max, j_binning)[source]

Get the finite bin edges.

legend(**kwargs)

Draw a legend in the upper right corner of the plot.

plot_array(array=None, density=True, stack_function=<function mean>, margin_function=<function sum>, scatter=-1, **kwargs)

Plot an array.

Parameters
arrayndarray, optional

The data to be plotted.

densitybool or list of int, optional

Divide the data by the relative bin width: width / total_plot_range. Dividing by the relative bin width, rather than the bin width directly, ensures that the maximum values in all 1D projections are comparable. If a list of ints, only the bin widths in the respective binnings will be used for the division.

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.

margin_functionfunction, optional

The function used to marginalize the data.

scatterint, optional

Use a pseudo scatter plot with scatter number of points instead of a 2D histogram. Allows to draw multiple sets of 2D data in the same plot. The number of points in each cell is proportional to the value being plotted. Using the scatter option is thus implicitly replicating the behaviour of the density option for the 2D plots. The density argument has no effect on the scatter plots.

plot_entries(binning=None, **kwargs)

Plot the entries of a Binning.

plot_sumw2(binning=None, **kwargs)

Plot the sumw2 of a Binning.

plot_values(binning=None, **kwargs)

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.