-
Notifications
You must be signed in to change notification settings - Fork 28
Description
import numpy as np
import hist
hist1 = hist.Hist.new.Reg(50, 0, math.pi).Double()
hist1.fill(np.random.uniform(0, math.pi,200))
hist1.plot()
gives with (poisson) errorbars
while
import numpy as np
import hist
hist1 = hist.Hist.new.Reg(50, 0, math.pi).Double()
hist1.fill(np.random.uniform(0, math.pi,200),weight=np.random.uniform(0, math.pi,200))
hist1.plot()
gives none
I would have expected that it behaves like e.g. yoda
that the weights squared produce the variance/uncertainty.
The docs https://hist.readthedocs.io/en/latest/reference/hist.plot.html#hist.plot.histplot say that I can give yerr
, but yerr
needs to be a vector of weights squared per bin. I don't think I should have to compute that myself, if I already filled the bins with the weights unsquared!
I could not find an example for this common case in the docs.
What is the recommended/right/best way to plot in hist with weights?
Note: on the webpage there seems to be a small formatting error:
Histogram object with containing values and optionally bins. Can be:
is followed by bulletpoints, while
Histogram uncertainties. Following modes are supported:
does show dashes without newlines per case.