Re: myStyle->SetPalette(1,0)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jul 27 1999 - 10:02:50 MEST


Hi Jeffrey,
This was implemented in 2.22/07.
Upgrade your system to the public released version 2.22/09

Rene Brun

Jeffrey Reid wrote:
> 
> {using ROOT_LEVEL : 2.22.06}
> 
> I have a 2d histogram that I want to plot using a "pretty spectrum". In
> the documentation for SetPalette it says:
> 
>  if ncolors == 1 && colors == 0, then
>      a Pretty Palette with a Spectrum Violet->Red is created.
>    It is recommended to use this Pretty palette when drawing legos,
>    surfaces or contours.
> 
> So I setup a new style [myStyle], set the palette to the "pretty
> spectrum" and then set the current style to myStyle:
> 
> TStyle *myStyle = new TStyle("myStyle","my style");
> myStyle->SetPalette(1,0);
> myStyle->cd();
> 
> Now I plot my 2d histogram using "colz":
> 
> MyHistogram.Draw("colz");
> 
> The problem is that the palette I get is not the "pretty spectrum" I
> expect, instead I get only 1 color (light grey). It seems to me that
> this SetPalette(1,0) isn't being treated as a special case, it is just
> giving me a grey gradient with 1 color (if I go to SetPalette(2,0) I get
> two shades of grey in the gradient, as I would expect).
> 
> How can I get the pretty violet->red spectrum that I crave so badly?
> 
> ---------------------------------------------------------------------
> Jeffrey G Reid  |  jgreid@u.washington.edu  |  UW Nuclear Physics Lab
> =====================================================================



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