ROOT Version: 6.20/02, 6.20/04
Platform: Ubuntu 16.04
Compiler: gcc
Dear experts,
@couet it seems log x scale for histograms is broken.
I tried both with 6.20/02 and 6.20/04.
Here’s a minimal macro reproducing the problem:
TF1 f("f", "10*pow(x,-2)", 1, 128)
double bins[7] = { 1, 2, 4, 16, 32, 64, 128 };
TH1F hist("h", "", 6, bins);
hist.SetMarkerStyle(kFullCircle);
hist.FillRandom("f");
hist.Print("range");
TCanvas c;
c.Divide(2, 2);
c.cd(1);
hist.SetTitle("Lin X, Lin Y");
hist.Draw("E1X0");
gPad->SetGrid();
c.cd(2);
TH1 *h = hist.DrawCopy("E1X0");
h->SetTitle("Log X, Lin Y");
gPad->SetGrid();
gPad->SetLogx();
c.cd(3);
h = hist.DrawCopy("E1X0");
h->SetTitle("Lin X, Log Y");
gPad->SetGrid();
gPad->SetLogy();
c.cd(4);
h = hist.DrawCopy("E1X0");
h->SetTitle("Log X, Log Y");
gPad->SetGrid();
gPad->SetLogx();
gPad->SetLogy();
and here’s the produced output and figure:
TH1.Print Name = h, Entries= 5000, Total sum= 5000
fSumw[1]=2515, x=1.5
fSumw[2]=1232, x=3
fSumw[3]=960, x=10
fSumw[4]=161, x=24
fSumw[5]=84, x=48
fSumw[6]=48, x=96
As you can see, the histogram content is correct, but when log x scale is used, the bins are all messed up.