colliderscope.histogram_barchart(hist: HistogramLike | tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]], hist_label: str, title: str = '', x_label: str = 'x', y_label: str = 'Probability density', overlays: dict[str, HistogramLike | ndarray[Any, dtype[float64]]] | None = None, opacity: float = 0.6, bar_style: 'bar' | 'line' = 'bar') PlotlyFigure

Automatically convert a Histogram object, and optionally a number of overlays, into a plotly bar chart / histogram.

Changed in version 0.2.6.

Added bar_style parameter.

Parameters:
hist : Histogram or tuple[ndarray[float], ndarray[float]]

Histogram data to render. May either be passed as a Histogram instance, or a two-tuple of numpy arrays of bin centres and probability densities, respectively.

hist_label : str

Label for the histogram in the plot legend.

title : str

Heading for the plot. Default is "".

x_label : str

Axis labels.

y_label : str

Axis labels.

overlays : dict[str, ndarray[float64] | HistogramLike], optional

Additional PDFs to overlay on the same plot. Keys are the labels displayed in the plot legend, and values are histograms, or densities corresponding to the same x-bins of hist. Default is None.

opacity : float

Value in range [0, 1] setting how opaque bars are. If using many overlays, lower values may improve visual clarity. Default is 0.6.

bar_style : {'bar', 'line'}

If passed as ‘bar’, the output will be adjacent column bars with a fill according to opacity. If ‘line’, continuous lines tracing the height of the bars will be created. In the latter case, opacity has no effect. Default is ‘bar’.

Returns:

Interactive plotly bar chart figure.

Return type:

PlotlyFigure


Last update: Jun 27, 2025