Re: [ROOT] Problem with (Option "E3") filled error bands due to empty bins and SetMinimum()

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Jul 10 2002 - 13:29:48 MEST


Hi Marc,

Thanks for reporting this problem.

Now fixed by Olivier Couet in the development version in CVS

Rene Brun

On Wed, 10 Jul 2002, Marc Brueggemann wrote:

> Hi everybody,
> 
> I realized a problem with drawing option "E3" to draw a colored error
> band. It occurs if I apply this option to a histogram which also
> contains empty bins and using the method 'SetMinimum()' simultaneously.
> Starting from the last bins the error band is focused to the origin.
> A strange fragment occurs.  
>    
> I have reduced the problem to a little macro which you can try out.
> It contains two loops for filling a histogram with errors. One loop
> leaves the first bins empty the other (uncomment it) fills
> all bins.   
> 
> 
> 
> Int_t Test(){
>   
>   TH1F* h_test = new TH1F("h_test","h_test", 45, 0, 12 );
>   
>   // for (Int_t i = 1; i <= 45; ++i) { // use this loop and no problem
>   // occurs (because no empty bins are present)
>   for (Int_t i = 6; i <= 45; ++i) {
>     h_test->SetBinContent(i, 4.0);
>     Float_t error = (40.1-i)/40.0;
>     h_test->SetBinError(i, error);
>   }
>   
>   TCanvas* canvas = new TCanvas("canvas", "canvas", 1);
>   h_test->SetMinimum(0.01);
>   h_test->SetMaximum(6);
>   h_test->SetFillColor(kRed);
>   h_test->Draw("E3");
>   h_test->Draw("P HIST SAME");
>   
> 
>   return 0;
> }
> 
> 
> The same fragment occurs if I don't use 'SetMinimum()' but afterwards
> (if I can see the histogram in a canvas) 
> try to zoom into a certain region of the y-axis.     
> 
> 
> The question: Does this problem also occur if you try this
>               macro?
> 
> Am I doing something wrong?? How can I keep ROOT from connecting the
> error band with the origin ???
> 
> I'm using ROOT-version 3.02/02 
> (I also tried version 2.24/05 and the same problem occured) 
> 
> 
> 
> Best regards
> 
>   Marc Brueggemann 
> 
> --
> Marc Brueggemann        mailto:bruegge@Physik.Uni-Dortmund.DE
> Experimentelle Physik Vb            phone: +49 (231) 755 3667
> Dortmund University
> D-44227 Dortmund
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:59 MET