fix1dmw(x, weights, bins=10, range=None, flow=False)¶
Histogram data with multiple weight variations and fixed width bins.
x (array_like) – data to histogram.
weights (array_like) – The weight variations for the elements of
x, first dimension is the length of
x, second dimension is the number of weights variations.
bins (int) – The number of bins.
flow (bool) – If True, the under and overflow bin contents are added to the first and last bins, respectively.
Multiple histograms of
xwith 50 bins between 0 and 100; using 20 different weight variations:
>>> x = np.random.randn(10000) >>> twenty_weights = np.random.rand(x.shape, 20) >>> h, err = fix1dmw(x, w, bins=50, range=(-3, 3))
errare now shape
(50, 20). Each column represents the histogram of the data using its respective weight.