Re: [ROOT] 2d histogram: right number but wrong colour in col mode

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Mon Nov 08 2004 - 10:43:29 MET


Hi Reinhart,

 Can you send us something we can execute ? (without pseudo code like: 
"Some more calculations"). We will gain time ...

 Cheers,        Olivier Couet


On Sat, 6 Nov 2004, Reinhardt Chamonal wrote:

> Here is a short version of the "script" 
> 
> TH2F *correl =new TH2F("Correlation", "MaPTM #3",64,0.5,64.5,64,0.5,64.5);
> for(int i=1;i<=64;i++){    //pixel x
>   for(int j=1;j<=64;j++){  //pixel y
>  	Some calculatons
> 	for(int k=1;k<=ne;k++){ //loop over nb of entries 
> 	Some more calculations
>         }
>    float p=covXY/(sigmaX*sigmaY);
>    correl->Fill(i,j,p);
>   }
> }
> 
> Thanks
> 
> On Sat, 6 Nov 2004, Rene Brun wrote:
> 
> > Reinhart,
> > 
> > Please send the shortest possible script illustrating your problem.
> > 
> > A priori, it looks like you are filling bins with values of i or/and j
> > at the edge of the bin (precision problem). Instead, specify the bin 
> > center.
> > 
> > Rene Brun
> > 
> > On 
> > Sat, 
> > 6 Nov 2004, Reinhardt Chamonal wrote:
> > 
> > > Hi,
> > > 
> > > I am using v4.00/01
> > > I am filling a 2d histogram (wihtin a C porgram) , with:
> > > correl->Fill(i,j,p);
> > > where i and j are integers and p is a float.
> > > Now my problem is that when I draw the histogram in col mode sometimes the 
> > > color isn't right when my entry is 1, 1 being my maximum value. With a 
> > > palette from blue to red, sometimes it would be blue and sometimes red 
> > > eventhough the entry is one :(
> > > Any idea of what I might be doing wrong ?
> > > I have attached two pictures where the diagonal illustrates the problem.
> > > 
> > > Cheers
> > >  
> > > 
> > > 
> > > 
> > > 
> > 
> 
> 

-- 
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail: Olivier.Couet@cern.ch                            Phone:   +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/                    Fax:     +41 22 7677155



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET