Wrong world coords with bin contents<0 and SetNormFactor

Hi,
sometimes TH1F with negative bin contents and SetNormFactor don’t go well together, e.g. here:

void testmacro() { TCanvas* c=new TCanvas("c","c"); c->Divide(2,1); TH1F* h=new TH1F("h","h",10,0.,1.); for (Int_t i=0; i<10;i++) h->SetBinContent(i+1,(5.-2*i)*((i%2)*2 -1)); h->SetNormFactor(1.); c->cd(1); h->DrawClone(); h->Scale(-1.); c->cd(2); h->Draw(); }
For subpad 1 I get the error message:

Error in <TPad::Range>: illegal world coordinates range: x1=-0.125000, y1=0.144375, x2=1.125000, y2=-1.299375 Error in <TPad::RangeAxis>: illegal axis coordinates range: xmin=0.000000, ymin=0.000000, xmax=1.000000, ymax=-1.155000
What’s the reason, am I expecting something that can’t work? Why does it work if it’s mirrored?

win32gcc, 4.00/03; linux, 4.00/03.
Cheers, Axel.

Hi Axel,
Thanks for reporting this special case.
Now fixed in CVS.

Rene