ArrayPlotter

class remu.plotting.ArrayPlotter(array, bins_per_row=25, **kwargs)[source]

Bases: remu.plotting.Plotter

Plotting class for numpy arrays.

Parameters
arrayndarray

The ndarray to be plotted.

bins_per_rowint, optional

How many bins are going to be plotted per row.

**kwargsoptional

Addittional keyword arguments are passed to Plotter.

See also

Plotter

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.

array

(ndarray) The ndarray to be plotted.

bins_per_row

(int, optional) How many bins are going to be plotted per row.

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.

savefig(*args, **kwargs)

Save the figure.

subplots(*args, **kwargs)

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

get_axis_label()[source]

Return the default label for the axis.

get_bin_edges(i_min, i_max)[source]

Get the bin edges corresponding to bins i_min to i_max.

legend(**kwargs)[source]

Draw a legend in the first axis.

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

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.

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.