Re: [ROOT] TProfile2D and COLZ draw option

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Fri Jul 18 2003 - 09:06:02 MEST


Hi Eric,

 I see the problem now. It seems to be only on TProfile2D. If I replace 
the TProfile2D by a TH2D in the macro, the color levels on the plot and on 
the palette match correctly. I will check that. I'll let you know.

 Cheers,          Olivier


On Thu, 17 Jul 2003, Eric Thomas wrote:

> 
> 
> 
> Hi Olivier,
> 
> I tried your example and I am still puzzled by the matching between
> the bin content and the color code. I slightly modified your example
> for better reading of the output (I modified the binning and I superimposed
> the bin content on the plot). You can see the output at:
> 
> http://marwww.in2p3.fr/~ethomas/couet/couet.gif
> 
> 
> For example you can see the the most upper right bin is yellow, while
> I expected it to be orange, according to my understanding of the color panel.
> 
> 
> Here is copy/paste of the code I used to produce the plot.
> 
> {
>   TCanvas *c1 = new TCanvas("c1","Profile histogram example",200,10,700,500);
>   hprof2d  = new TProfile2D("hprof2d","Profile of pz versus px and py",10,-4,4,10,-4,4,0,20);
>   Float_t px, py, pz;
>     for ( Int_t i=0; i<25000; i++) {
>      gRandom->Rannor(px,py);
>      pz = px*px + py*py;
>      hprof2d->Fill(px,py,pz,1);
>     }
>   gStyle->SetOptStat(0);
>   gStyle->SetPalette(1);
>   hprof2d->SetContour(10);
>   hprof2d->Draw("COLZ");
>   hprof2d->Draw("TEXT" "SAME");
> }
> 
> 
> Let me know if the output make sense.
> 
> Thanks for your help,
> 
> Eric
> 
> 
> Olivier Couet wrote:
> 
> > Hi Eric,
> >
> > I have tried to reproduce your problem with ROOT 3.05/05 on linux, but for
> > me it works fine. I used the following example:
> >
> > {
> >   TCanvas *c1 = new TCanvas("c1","Profile histogram example",200,10,700,500);
> >   hprof2d  = new TProfile2D("hprof2d","Profile of pz versus px and py",40,-4,4,40,-4,4,0,20);
> >   Float_t px, py, pz;
> >   for ( Int_t i=0; i<25000; i++) {
> >      gRandom->Rannor(px,py);
> >      pz = px*px + py*py;
> >      hprof2d->Fill(px,py,pz,1);
> >   }
> >   hprof2d->Draw("COLZ");
> > }
> >
> > Let me know.
> >
> >  Cheers,            Olivier
> >
> > On Wed, 16 Jul 2003, Eric Thomas wrote:
> >
> > > Hi All,
> > >
> > >
> > > Does the following command
> > >
> > > h440->Draw("COLZ");
> > >
> > > works properly in case h440 is a TProfile2D?
> > > I am wondering because the displayed colors doesn't match the
> > > panel's color code and the bin content.
> > > I am using root 3.05/00.
> > >
> > > Thanks for the help,
> > >
> > > Eric
> > >
> > >
> >
> > --
> > 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
> 
> 

-- 
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 : Thu Jan 01 2004 - 17:50:13 MET