I am not sure if this is a bug. The following code should draw a histogram bar with Log scale in X axis. However, bins look empty after the second bin.
import ROOT
h = ROOT.TH1D("h","",10,0,10)
h.FillRandom("pol0")
h.Draw("B")
ROOT.gPad.SetLogx()
There is an workaround, which consist in using the fill color option instead of the bar drawing option:
import ROOT
h = ROOT.TH1D("h","",10,0,10)
h.FillRandom("pol0")
h.SetFillColor(1)
h.Draw()
ROOT.gPad.SetLogx()
The problem arises when you apply log X, all bin content except the first one dissappear if draw option B is used. The following code do not draw the histogram as expected
{
auto h = new TH1D("h","",10,0,10);
h->FillRandom("pol0");
h->SetFillColor(1);
h->Draw("B");
gPad->SetLogx()
}
Indeed the “B” option does not make sense in the LogX scale. The doc should be updated. The “B” option is meant to produce this kind of plot : It goes not make sense in log.
I will investigate the color issue.