Re: [ROOT] "col" or "colz" in 2D histogram in 4.00.02 (Correction)

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Thu Mar 04 2004 - 09:35:00 MET


Seng,

 Bins "with zero content" are not drawn with option COL. This is how it is 
implemented (on users request). We will not change that. You can change 
the background's Pad color to match the first palette's color.
 Note that my example was just to show you how to define a grey scale 
palette.

 Olivier

On Wed, 3 Mar 2004, Woon-Seng Choong wrote:

> Olivier,
>     I tried what you suggest. I understand what you are trying to do. 
> You added a small value (e.g.) your function to avoid  getting zero.  
> But this doesn't resolve the fact that bin with zero content is not 
> assigned the correct color.  I guess I can add small value uniformly to 
> my image to avoid zero content, but I believe bin with zero content 
> should be assigned the correct color.
> 
> 	Seng
> 
> 
> On Mar 3, 2004, at 1:48 AM, Olivier Couet wrote:
> 
> >
> >
> > Hi Seng,
> >
> >  try this:
> >
> > {
> >    TF2 *f2 = new 
> > TF2("f2","0.1+1000*((1-(x-2)*(x-2))*(1-(y-2)*(y-2)))",1,3,1,3)>
> >    Int_t ncol = 100;
> >    Int_t colors[ncol];
> >    TColor *col;
> >    Double_t dg=1/(Double_t)ncol;
> >    Double_t grey=0;
> >    for (Int_t i=0; i<ncol; i++) {
> >       colors[i]= i+100;
> >       col = gROOT->GetColor(colors[i]);
> >       col->SetRGB(grey, grey, grey);
> >       grey = grey+dg;
> >    }
> >    f2->SetContour(ncol);
> >    gStyle->SetPalette(100,colors);
> >    f2->Draw("colz");
> > }
> >
> >  Olivier
> >
> > On Tue, 2 Mar 2004, Woon-Seng Choong wrote:
> >
> >>    I made a typo in my previous email.  Here is the correct version.
> >> Olivier just helped me to define more grayscale color. But when I draw
> >> an image using 2D-histogram using the "col" or colz" option, bin with
> >> zero content shows up as white (black being low count and white being
> >> high count).  It looks correct with "surf/color" draw option.  In
> >> addition, even in the DeepSea palette, bin with zero content still
> >> shows up as white. My guess is no color is assigned to bin with zero
> >> content. Is this a bug?
> >>
> >> 	Seng
> >>
> >>
> >
> > -- 
> > 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 : Sun Jan 02 2005 - 05:50:06 MET