Problem with Logy scale on empty TH1

Dear experts,
while trying to have a TH1, with logy scale but empty of data I get the following error message:

root [0]  TH1F * h1  = new TH1F("h1", "h1; index ; entries", 360, 0., 360.) ;
root [1]  h1->Draw()                                                                    
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] gPad->SetLogy()
Error in <THistPainter::PaintInit>: log scale is requested but maximum is less or equal 0 (0.000000) 

and of course, the histogram is not displayed properly anymore.
I need to set the logy scale a priori, independently from the fact that the histogram might be filled or not.
Is there a way to do that?
I use Root version v5-26-00b.

Thank you in advance.
fb

you must call h1->SetMinimum and Maximum, otherwise the minimum being 0 does not make any sense in log scale.

Rene

1 Like

Thanks!