TH1 error disappears when content is off-screen


I notice that when the bin content of a TH1 is beyond the range of a canvas, the associated bin error does not appear, even if this error is within the range of the canvas.

Is there a way to retain this error on the canvas? I prefer to not lose this information.


import ROOT

h = ROOT.TH1F("h", "h", 1, 0.0, 1.0)
h.SetBinContent(1, 1)
h.SetBinError(1, 1)

h.SetMaximum(1.5) # content is in range, error is in range => error appears on plot
# h.SetMaximum(0.8) # content is not in range, error is in range => error does not appear on plot



The error appears if I use the option “E0”. Thanks noeldawe for the tip. Could the THistPainter doc be updated with this information? The current description does not mention this.

"E0: Draw error bars. Markers are drawn for bins with 0 contents."