pyrad.graph.plot_histogram#
- pyrad.graph.plot_histogram(bin_edges, values, fname_list, labelx='bins', labely='Number of Samples', titl='histogram', binwidth_equal=False, dpi=72, labels=None, alpha=None)[source]#
Compute and plot one or several histograms.
- Parameters:
bin_edges (array-like or list of array-like) – Histogram bin edges. If a single array is provided, it is used for all value arrays. If a list is provided, each entry is used for the corresponding value array.
values (array-like or list of array-like) – Data values. Can be a single array or a list of arrays to plot several distributions on the same axis.
fname_list (list of str) – List of filenames where the plot will be saved.
labelx (str, optional) – Label of the x-axis.
labely (str, optional) – Label of the y-axis.
titl (str, optional) – Figure title.
binwidth_equal (bool, optional) – If True, bars are plotted with equal visual width regardless of the actual bin size.
dpi (int, optional) – Dots per inch.
labels (list of str, optional) – Labels for each distribution. If provided, a legend is added.
alpha (float, optional) – Transparency of the histogram (only used for single distribution).
- Returns:
fname_list (list of str) – List of filenames of the created plots.