Re: Draw("COL")

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Mar 26 1998 - 09:08:13 MET


Xavier Bertou wrote:
> 
>         Hello,
> 
> I'm using Draw("COL") and would like to be able to define my own levels
> just like histo->SetContour() does for Draw("CONT"). Is it possible ?
> 
> Another thing : how can I define a palette with RGB components ? (cf
> "color" command with PAW).
> 
> Thanx,
> Xavier Bertou

A small macro illustrating how to define a new color palette.

Rene Brun

{
   gROOT->Reset();
   TH2F hxy = new TH2F("hxy","test palette",40,-4,4,20,-4,4);
   Float_t x,y;
   for (Int_t i=0;i<1000;i++) {
      gRandom->Rannor(x,y);
      hxy->Fill(x,y);
   }

//  Create a new color palette with only 10 colors
   Int_t colors[]={1,22,33,42,5,6,7,8,9,2};
   gStyle->SetPalette(10,colors);
   hxy->Draw("col");

//   the default palette is given in the following table
//   Int_t colors[50] = {19,18,17,16,15,14,13,12,11,20,
//                       21,22,23,24,25,26,27,28,29,30, 8,
//                       31,32,33,34,35,36,37,38,39,40, 9,
//                       41,42,43,44,45,47,48,49,46,50, 2,
//                        7, 6, 5, 4, 3, 112,1};
//   gStyle->SetPalette(50,colors);
}



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:31 MET