Closed jkguiang closed 3 years ago
Thanks, will look into this. In the meantime, it's probably best to remake the histogram with the restricted binning. That way the error is propagated properly for the overflow entries.
This is in version 1.14 now.
from yahist import Hist1D
h = Hist1D.from_random(bins="30,-3,3")
h.plot(label="orig", lw=5)
h.restrict(-2, 2).plot(label="restricted", lw=3)
h.restrict(-2, 2, overflow=True).plot(label="restricted with overflow=True", lw=1)
gives
When a user calls the
restrict
method for a histogram, it would be nice to add an option to have the clipped bins be consolidated into overflow bins. This could be accomplished with some numpy in the backend and an additional kwarg:where the backend implementation would be
or "something like that."