RE: Different color palettes within one canvas

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Tue, 25 Nov 2008 13:32:04 +0100


Example:
{

   TCanvas *c1 = new TCanvas("c1");    

   TH2F *h1 = new TH2F("h1","h1",40,-4,4,40,-4,4);    TH2F *h2 = new TH2F("h2","h2",40,-4,4,40,-4,4);    Double_t a,b;
   for (Int_t i=0;i<5000;i++) {

      gRandom->Rannor(a,b);
      h1->Fill(a-1.5,b-1.5);
      h2->Fill(a+1.5,b+1.5);

   }
   TExec *ex1 = new TExec("ex1","gStyle->SetPalette(0);");    TExec *ex2 = new TExec("ex2","gStyle->SetPalette(1);");    h1->Draw("colz");
   ex1->Draw();
   h1->Draw("col same");
   ex2->Draw();
   h2->Draw("col same");
}

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of OKUMURA, Akira
Sent: Monday, November 24, 2008 8:44 PM
To: roottalk (Mailing list discussing all aspects of the ROOT system) Subject: Re: [ROOT] Different color palettes within one canvas

Hello ROOTers,

I have a question about using two palettes in one canvas. I found a similar topic from the RootTalk archive that was posted 7 years ago. http://root.cern.ch/root/roottalk/roottalk01/1543.html

What is the best solution in 2008?

Regards,

OKUMURA, Akira oxon_at_ceres.phys.s.u-tokyo.ac.jp Department of Physics, The University of Tokyo 7-3-1 Hongo, Bunkyo-ku, Tokyo 113-0033
TEL/FAX +81 3-5841-4173/4059
Skype : okumura.akira Received on Tue Nov 25 2008 - 13:32:09 CET

This archive was generated by hypermail 2.2.0 : Tue Nov 25 2008 - 17:50:01 CET