Missing lowest part of Y axis when using log scale

Hello,

I have a TH2 with the bit KCanRebin set. I add 2 values, one high and one low (on Y). I can see both of them as long as I don’t set a logarithmic scale on Y.

I don’t understand why the lowest part of Y axis is not displayed.

Here is the code:

root [0] TH2F *h2 = new TH2F("h", "h", 21, 0, 21, 100, 0, 1000) root [1] h2->SetBit(TH2::kCanRebin); root [2] h2->Fill(8, 1000) (Int_t)1182 root [3] h2->Fill(10, 10) (Int_t)34 root [4] h2->Draw("colz") <TCanvas::MakeDefCanvas>: created default TCanvas with name c1 root [5] gPad->SetLogy()

Do you have an explanation ?
Sorry if it is trivial…

Cheers,
Barth

Olivier will investigate this problem once he will be back from holidays.
Meanwhile, I suggest removing the line
h2->SetBit(TH2::kCanRebin);

Rene

Ok, thank you.

Barth

Hi,

After the great success of the thread http://root.cern.ch/phpBB3//viewtopic.php?f=3&t=11082&p=47844&hilit=barth#p47844, could you have a look at this problem ? :slight_smile:

Thank you !
Barth

Yes I’ll look at it :slight_smile:

Your histogram starts at zero along Y. Log of zero is not defined. In such a case the minimum is set to 3 decades below the maximum (if the maximum is positive). The bin you added is below the 3 decades that’s why it goes away. If you set the minimum to something just above zero, then the bin is still visible in log scale.

{
   TH2F *h2 = new TH2F("h", "h", 20, 0, 21, 20, 0.01, 1000); 
   h2->SetBit(TH2::kCanRebin);  
   h2->Fill( 8., 1000.);
   h2->Fill(10.,   10.);
   h2->Draw("COL");
}

Hi,

Thank you, I understand now. I will put correct bounds.

Cheers,
Barth