How to Define a new Color Palette?

Frederic FAURE (faure@labs.polycnrs-gre.fr)
Wed, 19 May 1999 10:42:22 +0200


Hello,
i would like to use a colour palette of grey (from white to black).

Following an exemple, I try the following code.
It works with : Draw("col");
but doesn't work with: Draw("cont") (and i want to use this option).

Do you know how to correct this?
Thanks,
Fred

//-----------------------------------

const int colNum=10; // nombre de couleurs
const int colPoint=3; // numero de la couleur de depart

TSeqCollection *colorList=gROOT->GetListOfColors();
while(colorList->LastIndex()>0)
colorList->RemoveLast();

int mypalette[colNum]; // numero des couleurs
for ( int i=0; i< colNum; i++)
{

TColor(i+colPoint,1-(i/((colNum)*1.0)),1-(i/((colNum)*1.0)),1-(i/((colNum)*1.0)),"
"); // gris
if((i+colPoint)<100)
{
colorList->RemoveLast(); //TColor *light
colorList->RemoveLast(); //TColor *dark
}
mypalette[i]=i+colPoint;
}

gStyle->SetPalette(colNum,mypalette);

TF2 *f2 = new TF2("f2","exp(-(x^2) - (y^2))",-3,3,-3,3);
f2->SetContour(colNum);
f2->SetFillColor(0);

f2->Draw("cont");
//--------------------------------------

-- 
Frederic Faure
LPMMC (Maison des Magisteres Jean Perrin, CNRS)
BP 166 38042 Grenoble Cedex 9 France
email: faure@labs.polycnrs-gre.fr
tel: 04 76 88 74 98
fax: 04 76 88 79 81