RE: how to put tex in

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Thu, 2 Jul 2009 10:28:30 +0200


Example:

{

   TCanvas *C = new TCanvas("C","C",800,600);    C->Divide(2,2);
   TText t;
   char str[4];
   for (int i=1; i<=4; i++) {

      C->cd(i);
      sprintf(str,"(%d)",i);
      t.DrawTextNDC(0.5,0.5,str);

   }
}

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Bian JianMing Sent: Thursday, July 02, 2009 10:20 AM
To: achilleas
Cc: roottalk (Mailing list discussing all aspects of the ROOT system.) Subject: [ROOT] how to put tex in

Hi all,
May be a stupid question. How can i put (a) (b) (c) (d) .. in each pad of a canvas?

With my best wishes,

Bian Jianming
Experimental Physics Center,
Institute of High Energy Physics(IHEP),
Chinese Academy of Sciences
P.O.Box 918-1
Beijing, 100049
P.R.China

achilleas $B<L(B:

> Hello all,
>
> I have the following wierd behaviour in a stack of histograms (THStack)
> with a logarithmic y-axis: the color (only) of the last bin of (only) one
> of the stacked histograms gets somehow changed into the color of another
> histogram. The effect dissapears when I remove the log scale at the
> y-axis. Note that the sum of values in the last bin is actually correct -
> it's only the colour that gets mixed up.
>
>
> Here is the code:
>
> void miscolored_bin() {
>
> THStack *hs = new THStack("hs","miscolored bin effect in stacked
> histograms");
> TH1F *h1_gluons = new TH1F("h1","E1 accuracy",4,0,400);
> TH1F *h1_qqgluons = new TH1F("h2","E1 accuracy",4,0,400);
> TH1F *h1_bar = new TH1F("h3","E1 accuracy",4,0,400);
>
> h1->Fill(50,1000.0);
> h1->Fill(150,100.0);
> h1->Fill(250,10.0);
> h1->Fill(350,1.0);
> h2->Fill(50,1000.0);
> h2->Fill(150,100.0);
> h2->Fill(250,10.0);
> h2->Fill(350,1.0);
> h3->Fill(50,1000.0);
> h3->Fill(150,100.0);
> h3->Fill(250,10.0);
> h3->Fill(350,1.0);
> h1->SetFillColor(kBlue);
> h2->SetFillColor(kGreen);
> h3->SetFillColor(kRed);
>
> hs->Add(h1);
> hs->Add(h2);
> hs->Add(h3);
> TCanvas *c1 = new TCanvas("c1","big canvas",0,0,1200,800);
> gPad->SetLogy();
> gPad->SetGrid();
> hs->Draw();
> }
>
Received on Thu Jul 02 2009 - 10:28:41 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 02 2009 - 11:50:04 CEST