var1d(x, bins, weights=None, density=False, flow=False)¶
Histogram data with variable bin widths.
x (array_like) – data to histogram
bins (array_like) – bin edges
weights (array_like, optional) – weight for each element of
density (bool) – normalize histogram bins as value of PDF such that the integral over the range is 1.
flow (bool) – if
Truethe under and overflow bin contents are added to the first and last bins, respectively
A simple histogram with variable width bins:
>>> x = np.random.randn(10000) >>> bin_edges = [-3.0, -2.5, -1.5, -0.25, 0.25, 2.0, 3.0] >>> h, __ = var1d(x, bin_edges)