fix1d(x, bins=10, range=None, weights=None, density=False, flow=False)¶
Histogram data with fixed (uniform) bin widths.
x (array_like) – Data to histogram.
bins (int) – The number of bins.
weights (array_like, optional) – The weights for each element of
density (bool) – If True, normalize histogram bins as value of PDF such that the integral over the range is one.
flow (bool) – If True, the under and overflow bin contents are added to the first and last bins, respectively.
A histogram of
xwith 20 bins between 0 and 100:
>>> h, __ = fix1d(x, bins=20, range=(0, 100))
The same data, now histogrammed with weights:
>>> w = np.abs(np.random.randn(x.shape)) >>> h, h_err = fix1d(x, bins=20, range=(0, 100), weights=w)