pept.plots.histogram#

pept.plots.histogram(data, nbins=None, histnorm='percent', marginal='box', xlim=None, ylim=None, xaxis_title=None, yaxis_title=None, **kwargs)[source]#

Create histogram of data with PEPT-relevant defaults for plotly.express.histogram.

You can check the official documentation for all available options: https://plotly.github.io/plotly.py-docs/generated/plotly.express.histogram.html.

Parameters
data(N,) numpy.ndarray-like

A 1D vector of values to histogram.

nbinsint, optional

Positive integer. Sets the number of bins.

histnormstr, default “percent”

One of ‘percent’, ‘probability’, ‘density’, or ‘probability density’ If None, the output of histfunc is used as is. If ‘probability’, the output of histfunc for a given bin is divided by the sum of the output of histfunc for all bins. If ‘percent’, the output of histfunc for a given bin is divided by the sum of the output of histfunc for all bins and multiplied by 100. If ‘density’, the output of histfunc for a given bin is divided by the size of the bin. If ‘probability density’, the output of histfunc for a given bin is normalized such that it corresponds to the probability that a random event whose distribution is described by the output of histfunc will fall into that bin.

marginalstr, default “box”

One of ‘rug’, ‘box’, ‘violin’, or ‘histogram’. If set, a subplot is drawn alongside the main plot, visualizing the distribution.

xlimlist of two numbers, optional

If provided, overrides auto-scaling on the x-axis in cartesian coordinates.

ylimlist of two numbers, optional

If provided, overrides auto-scaling on the y-axis in cartesian coordinates.

xaxis_titlestr, optional

X-axis label.

yaxis_titlestr, optional

Y-axis label.