Here is an example
void h2color() {
TF2 *f2 = new TF2("f2","xygaus",-4,4,-4,4);
f2->SetParameters(130,-1.4,1.8,1.5,1);
TH2F *h1 = new TH2F("h1","h1",20,-4,4,20,-4,4);
h1->SetMarkerColor(kRed);
h1->FillRandom("f2",40000);
h1->Draw();
f2->SetParameters(150,2,0.5,-2,0.5);
TH2F *h2 = new TH2F("h2","h2",40,-4,4,40,-4,4);
h2->SetMarkerColor(kBlue);
h2->FillRandom("f2",40000);
h2->Draw("same");
f2->SetParameters(36,-2,0.7,-3,0.3);
TH2F *h3 = new TH2F("h3","h3",40,-4,4,40,-4,4);
h3->SetMarkerColor(kBlack);
h3->FillRandom("f2",40000);
h3->Draw("same");
}
Rene Brun
On Wed, 13 Nov 2002, Ray Fliller III wrote:
>
> Hello Rooters,
>
>
> I would like to superimpose two TH2F scatter plots in a TCanvas with
> each scatter plot being a different color. I have tried changing the
> Line,Fill, and Marker colors but nothing works. Is there a way to do this
> in root.
>
> I am using the CVS version from last Monday.
>
> --
>
> RAINMAN
> "How much does a piece of gum cost Ray?"
> "About $100."
> "How much does a new car cost Ray?"
> "`Bout $100."
> "There goes working for NASA!"
>
> ==================================================================
> Ray Fliller: rfliller@bnl.gov Office Phone: (631)-344-6124
> C-A Accelerator Physics Dept. Fax: (631)-344-5954
> Building 911B
> Brookhaven National Lab
> Upton, NY 11973 Office: Room 211
>
> http://www.agsrhichome.bnl.gov/People/rfliller/
> ==================================================================
>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:17 MET