Re: [ROOT] Histogram plotting....

From: Olivier Couet (Olivier.Couet@cern.ch)
Date: Mon Apr 07 2003 - 16:47:12 MEST


Hi Ray,

>    Hello rooters. 
> 
>     I am using ROOT cvs from April 1.  

 Not a joke ? :-)
 

> I have two TH2F's that I would like
> to plot on top of each other using the "SCAT" option, and have each
> histogram be a different color.  What is the best way to do
> this??  Thanks.

Here is an example. With TF2s but it is the same with TH2

{
   TF2 *f1 = new TF2("f1","(sin(x)/x)*(cos(y)*y)",-6,6,-6,6);
   f1->Draw("scat");
   TF2 *f2 = new TF2("f2","(sin(x)*x)*(cos(y)/y)",-6,6,-6,6);
   f2->SetMarkerColor(2); 
   f2->Draw("scat same");
}

 So, change the color with SetMarkerColor and plot the 2nd histo with the 
option "scat same".

  Olivier

-- 
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:10 MET