Re: [ROOT] TF2::Draw() question

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Thu Jul 24 2003 - 16:46:29 MEST


Hi Ed,

try this:

{
   TCanvas *c  = new TCanvas("c","Contours",0,0,800,700);
   TF2 *f2 = new TF2("f2","0.1+1000*((1-(x-2)*(x-2))*(1-(y-2)*(y-2)))",1,3,1,3);
   f2->SetFillStyle(1000);
   f2->SetLineWidth(1);
   double contours[3];
   contours[0] = 500;
   contours[1] = 700;
   contours[2] = 900;
   f2->SetContour(3,contours);
   Int_t colors[3] = {kRed, kYellow, kGreen};
   gStyle->SetPalette(3,colors);
   f2->Draw("cont0");  // Draw the fill area contour
   f2->Draw("cont3 same"); // draw the line contour on top
}

 Cheers,        Olivier



On Thu, 24 Jul 2003, Ed Oltman wrote:

> 
> Hello,
> 
> I am using root 3.05/5 on Win2k.  I have a TF2 object which I can Draw() and
> manipulate (e.g. zoom, add other object to it, etc...)  IF I use
> Draw("cont4"), I get a beautiful plot, but I cannot zoom or draw objects on
> top of - perhaps because, according to THistPainter doc, its really a
> surface plot with theta=0.
> 
> THistPainter doc says that "cont3" uses "fill area colors" How do I set the
> colors between the countours as they are in the "cont4" option.  When I draw
> with "cont3" option, all fill areas are white.  Thanks..
> 
> Ed
> 
> 
> 

-- 
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 : Thu Jan 01 2004 - 17:50:13 MET