Re: ROOT: TH1 undrawn last bin

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jul 27 1999 - 17:13:48 MEST


Hi Stephen,
As already reported by Philippe, this is a rounding problem that I have
now fixed in my development version.

Rene Brun

Stephen Bailey wrote:
> 
> Hi ROOTers.
> 
> The following script demonstrates an odd little problem.
> For the histogram h1, the last bin should be for values between
> 0.99 and 1.0.  It is apparently getting filled but it isn't drawn.
> It works for h2 which has a slightly different lower bound but
> the same upper bound.
> 
> I'm using ROOT 2.22/06 compiled with KAI KCC on Linux.
> 
> Any ideas what's wrong?  Thanks
> 
> Stephen
> 
> {
> TH1F h1("h1", "", 100, 0.0, 1.0);
> TH1F h2("h2", "", 100, 0.001, 1.0);
> 
> double little = 0.5;
> double big = 0.9;
> double bigger = 0.995;
> 
> for(int i = 0; i < 100; i++) {
>   h1.Fill(little); h1.Fill(big);  h1.Fill(bigger);
>   h2.Fill(little); h2.Fill(big);  h2.Fill(bigger);
> }
> 
> TCanvas c1("c1", "Histogram Testing");
> c1.Divide(1, 2);
> c1_1->cd(); h1.Draw();
> c1_2->cd(); h2.Draw();
> 
> }



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:36 MET