Hi,
I got some unexpected behaviour when I drew a TH2D histogram with the “CANDLE” option and logarithmic scale for the Y-axis. All “candles” were shifted out of the axis ranges. Using ROOT 5.34/32, I reproduced the problem with a modification of the example from https://root.cern.ch/root/html/THistPainter.html#HP140 (see code below). Is the CANDLE option incompatible with a logarithmic Y-axis?
Thanks for help!
{
const Int_t NBinsX = 30;
const Int_t NBinsY = 27;
const Double_t BinsX[31] = {
-3.0, -2.8, -2.6, -2.4, -2.2, -2.0,
-1.8, -1.6, -1.4, -1.2, -1.0,
-0.8, -0.6, -0.4, -0.2, 0.0,
0.2, 0.4, 0.6, 0.8, 1.0,
1.2, 1.4, 1.6, 1.8, 2.0,
2.2, 2.4, 2.6, 2.8, 3.0,
};
const Double_t BinsY[28] = {
1E-1, 2E-1, 3E-1, 4E-1, 5E-1, 6E-1, 7E-1, 8E-1, 9E-1,
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,
1E1, 2E1, 3E1, 4E1, 5E1, 6E1, 7E1, 8E1, 9E1,
1E2
};
TCanvas *c1 = new TCanvas("c1","c1",600,400);
TH2D *hcandle = new TH2D("hcandle","Option CANDLE example",NBinsX,BinsX,NBinsY,BinsY);
Double_t px, py;
for (Int_t i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
hcandle->Fill(px,5*py*py);
}
hcandle->SetMarkerSize(0.5);
hcandle->Draw("CANDLE");
c1->SetLogy();
return c1;
}