When I draw a histogram with the option “E0 P” on a log-y axis, I notice that the points for bins with zero entries in them are drawn on the bottom of the y-axis. Please see the example code below, which produced the attached file text.pdf.
test.pdf (15.9 KB)
The plot on the left, with a linear y-axis, behaves as expected. For bins with zero entries, the points are not visible, but the poisson error bars are visible. The plot on the right is a similar plot, but with a log y axis. The error bars are fine, but for some reason the points for empty bins are drawn, in this case at y=1, which is wrong. Is this a bug?
I am using root version 6.02/00
Thanks,
Emyr
[code]{
TCanvas *c1 = new TCanvas(“c1”,"",800,800);
c1->Divide(2);
TH1D * h1 = new TH1D(“h1”,“h1”,50,-4,4);
h1->SetMarkerStyle(21);
h1->FillRandom(“gaus”,100);
h1->SetBinErrorOption(TH1::kPoisson);
c1->cd(1);
h1->GetYaxis()->SetRangeUser(1,15);
h1->Draw(“E0 P”);
TH1D * h2 = new TH1D(“h2”,“h2”,50,-4,4);
h2->SetMarkerStyle(21);
h2->FillRandom(“gaus”,100);
h2->SetBinErrorOption(TH1::kPoisson);
c1->cd(2);
h2->GetYaxis()->SetRangeUser(1,15);
h2->Draw(“E0, P”);
gPad->SetLogy();
gPad->Update();
}[/code]