while, if I don’t use Poisson error bars (by removing histo.SetBinErrorOption(ROOT.TH1.kPoisson)), I obtain the desired behaviour for the empty bins (but I don’t get Poisson bars of course )
it’s still the same, even if I use ‘E’ instead of ‘E0’.
And it is still the same, but different from yours, even if I copy your snippet (as in my previous message).
Indeed that’s not a graphics issue. When you paint a histogram with any of the E option, if an error is present on a bin then the error bar is drawn for that bin… That sounds logical… The Poisson option add error on bins with 0 content. Errors are there … they are painted.
May be @moneta can give more details why the bins with 0 content have errors with the Poisson option.
In general, I think it would be good to have both options and let the user decide whether display error bars for empty bins or not. I’ve received “editorial requests” in both directions, depending on the analysis.
We can decide to not draw the empty bins with option E even if they have errors. The option E0 would allow to draw them if needed. But meanwhile here is a very simple workaround:
{
auto histo = new TH1F("histo", "histo", 20, -5, 5);
histo->SetBinErrorOption(TH1::kPoisson);
histo->GetYaxis()->SetRangeUser(0.00001,6.5);
histo->FillRandom("gaus", 10);
histo->SetMarkerStyle(8);
histo->Draw("E");
}