[ROOT] Titles

From: Ilia Ravinovich (ravini@wicc.weizmann.ac.il)
Date: Mon Apr 09 2001 - 12:08:11 MEST


Hi Rene,

I can not put titles 'gr1->GetHistogram()->SetXTitle("P_{t}, GeV/c");' in
the following macro, perhaps I'm doing something wrong ...
The version is 'Version   3.00/06     12 March 2001', Linux RH6.1

Thanks,

Ilia

==========================================================================
{

gROOT->Reset();

gStyle->SetCanvasColor(0);
gStyle->SetFrameFillColor(0);
gStyle->SetHistLineWidth(3);

TCanvas c1("invn","LAMBDA->PK-",10,10,600,800);
c1.Divide(1,2);
c1->SetFillColor(0);
c1->SetGrid();

   Int_t n1 = 6;
   Double_t x1[]  = {0.50,0.70,0.90,1.10,1.30,1.50};
   Double_t y1[]  = {0.28,0.44,0.78,0.87,0.77,0.40};
   Double_t ex1[] = {0.10,0.10,0.10,0.10,0.10,0.10};
   Double_t ey1[] = {0.09,0.08,0.06,0.08,0.11,0.28};

   gr1 = new TGraphErrors(n1,x1,y1,ex1,ey1);

   gr1->SetMaximum(1.5);
   gr1->SetMinimum(0.);
   gr1->SetTitle("#Lambda-bar/#Lambda ratio");
   gr1->SetMarkerColor(2);
   gr1->SetMarkerStyle(20);
   gr1->SetMarkerSize(2.0);
   c1.cd(1);
   gr1->Draw("ALP");

   Int_t n2 = 6;
   Double_t x2[]  = {29.6,123.7,193.5,248.7,292.8,346.7};
   Double_t y2[]  = {0.87,0.61,0.54,0.67,0.82,0.63};
   Double_t y2[]  = {0.63,0.82,0.67,0.54,0.61,0.87};
   Double_t ex2[] = {0.10,0.10,0.10,0.10,0.10,0.10};
   Double_t ey2[] = {0.13,0.11,0.09,0.09,0.09,0.10};

   gr2 = new TGraphErrors(n2,x2,y2,ex2,ey2);

   gr2->SetMaximum(1.5);
   gr2->SetMinimum(0.);
   gr2->SetTitle("#Lambda-bar/#Lambda ratio");
   gr2->SetMarkerColor(2);
   gr2->SetMarkerStyle(20);
   gr2->SetMarkerSize(2.0);
   c1.cd(2);
   gr2->Draw("ALP");

   c1->Update();

   c1->GetFrame()->SetFillColor(42);
   c1->GetFrame()->SetBorderSize(10);
   gr1->GetHistogram()->SetXTitle("P_{t}, GeV/c");
   gr1->GetHistogram()->SetYTitle("Ratio");

   c1->Modified();

}

************************************************************************
*                                                                      *
*   Ilia Ravinovich                                                    *
*   Department of Particle Physics             PPE Division            *
*   Weizmann Institute of Science              Bld 892, 1D-015         *
*   Rehovot 76100                              CERN, 1211 Geneva       *
*   ISRAEL                                     Switzerland             *
*                                                                      *
*   PHONE : 972 8 9343187                      41 22 7676437           *
*   FAX   : 972 8 9466253                      41 22 7677910           *
*   E-mail: Ilia.Ravinovich@weizmann.ac.il     Ilia.Ravinovich@cern.ch *
*                                                                      *
************************************************************************



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:41 MET