TH1 error disappears when content is off-screen

Hi,

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.

Alex

import ROOT

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

h.SetMinimum(0.0)
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
h.Draw()

raw_input()

Hi,

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.

Alex

root.cern.ch/root/html/THistPainter.html
"E0: Draw error bars. Markers are drawn for bins with 0 contents."