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
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET