Re: [ROOTTALK] Trouble with the "surf3" option

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Apr 24 1999 - 19:22:27 MEST


On Fri, 23 Apr 1999, Gerco Onderwater wrote:

> Hi All,
> 
> I am in the process of preparing a few nice plots using the surf3 (hidden
> line + contour) option for plotting a 2D histo. I noticed a few oddities: 
> 
> 1) when I scale the histo using hist->Scale() the contour levels do not
> scale accordingly.

Hi Gerco,
TH1::Scale ignores contours. I have implemented the scaling
of contours in my development version.
Thanks for reporting this inconsistency.

> 
> 2) when I change the histogram fill attributes, horrible things happen to
> the color scheme of the contour plot. Perhaps not surprising, but at least
> undocumented as far as I can figure out. 


The contours,surfaces, etc routines use the current
color palette definition with the following algorithm:
 colorContour[i] = histFillColor + palette[i]
The default palette defined in TStyle::SetPalette is defined as:
   Int_t palette[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};

You can change this definition via 
   gStyle->SetPalette(myPalette);
I suggest you define myPalette as:
   Int_t myPalette[50];
   for (Int_t i=0;i<50;i++) {
      myPalette[i] = i;
   }
   gStyle->SetPalette(30,myPalette);
then do
  myHist->SetFillColor(0);
  myHist->Draw("cont"); //or surf, etc
You can see the current color table by selecting "View colors"
in the cancas menu bar.

> 
> Next, I would like to propose (in public this time) to add a [ROOTTALK]
> prefix to the subject line of mail forwarded by the list (as you see in
> the subject line of this mail). There must be a way to have this done
> automatically by the list server. This simplifies the process of cleaning
> up my mailbox considerably (everybody is of course sending very relevant
> stuff to roottalk, but I would still like to be able to delete it without
> too much effort :) 
> 


Fons will reply to your proposal for roottalk.

Rene Brun



> Aju,
> 
> Gerco
> 
> 
> PS. I'm using root version 2.21/08 with Debian Linux on a Pentium PC.
> 
> 
> --
> 
> Dr. C.J.G. Onderwater
> Nuclear Physics Laboratory
> 312 Loomis Laboratory of Physics
> University of Illinois at Urbana-Champaign
> 1110 West Green Street
> Urbana, IL 61801-3080     
> Phone : (217) 244-7363
> Fax   : (217) 333-1215  
> E-mail: onderwat@uiuc.edu
> 



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