graphorge.ioput.plots.plot_histogram¶
- plot_histogram(data, data_labels=None, bins=None, bins_range=None, density=False, x_lims=(None, None), y_lims=(None, None), title=None, x_label=None, y_label=None, x_scale='linear', y_scale='linear', x_tick_format=None, y_tick_format=None, is_latex=False)[source]¶
Plot 1D histogram.
- Parameters:
data (tuple[numpy.ndarray(1d)]) – Histogram data set.
data_labels (tuple[str], default=None) – Histogram data sets labels. If None, then no labels are displayed.
bins ({int, tuple, str}, default=None) – Histogram bins, provided either as an integer (number of equal-width bins in the range) or as a sequence (bins edges). Some binning strategies are also available (e.g., ‘auto’, ‘fd’).
bins_range (tuple, default=None) – The lower (bins_range[0]) and upper (bins_range[1]) range of the bins, ignoring outliers outside the provided range. Not effective if bins sequence is provided.
density (bool, default=False) – If True, draw and return a probability density (area under the histogram integrates to 1).
title (str, default=None) – Plot title.
x_label (str, default=None) – x-axis label.
y_label (str, default=None) – y-axis label.
x_scale (str {'linear', 'log'}, default='linear') – x-axis scale. If None or invalid format, then default scale is set. Scale ‘log’ overrides any x-axis ticks formatting.
y_scale (str {'linear', 'log'}, default='linear') – y-axis scale. If None or invalid format, then default scale is set. Scale ‘log’ overrides any y-axis ticks formatting.
x_tick_format ({'int', 'float', 'exp'}, default=None) – x-axis ticks formatting. If None or invalid format, then default formatting is set.
y_tick_format ({'int', 'float', 'exp'}, default=None) – y-axis ticks formatting. If None or invalid format, then default formatting is set.
is_latex (bool, default=False) – If True, then render all strings in LaTeX. If LaTex is not available, then this option is silently set to False and all input strings are processed to remove $(…)$ enclosure.
- Returns:
figure (Matplotlib Figure) – Figure.
axes (Matplotlib Axes) – Axes.