Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
alignment.C
Go to the documentation of this file.
2{
3 TCanvas *Tlva = new TCanvas("Tlva","Tlva",500,500);
4 Tlva->SetGrid();
5 Tlva->DrawFrame(0,0,1,1);
6 const char *longstring = "K_{S}... K^{*0}... #frac{2s}{#pi#alpha^{2}} #frac{d#sigma}{dcos#theta} (e^{+}e^{-} #rightarrow f#bar{f} ) = #left| #frac{1}{1 - #Delta#alpha} #right|^{2} (1+cos^{2}#theta)";
7
8 TLatex latex;
9 latex.SetTextSize(0.025);
10 latex.SetTextAlign(13); //align at top
11 latex.DrawLatex(.2,.9,"K_{S}");
12 latex.DrawLatex(.3,.9,"K^{*0}");
13 latex.DrawLatex(.2,.8,longstring);
14
15 latex.SetTextAlign(12); //centered
16 latex.DrawLatex(.2,.6,"K_{S}");
17 latex.DrawLatex(.3,.6,"K^{*0}");
18 latex.DrawLatex(.2,.5,longstring);
19
20 latex.SetTextAlign(11); //default bottom alignment
21 latex.DrawLatex(.2,.4,"K_{S}");
22 latex.DrawLatex(.3,.4,"K^{*0}");
23 latex.DrawLatex(.2,.3,longstring);
24
25 latex.SetTextAlign(10); //special bottom alignment
26 latex.DrawLatex(.2,.2,"K_{S}");
27 latex.DrawLatex(.3,.2,"K^{*0}");
28 latex.DrawLatex(.2,.1,longstring);
29
30 latex.SetTextAlign(12);
31 latex.SetTextFont(72);
32 latex.DrawLatex(.1,.80,"13");
33 latex.DrawLatex(.1,.55,"12");
34 latex.DrawLatex(.1,.35,"11");
35 latex.DrawLatex(.1,.18,"10");
36 return Tlva;
37}
TCanvas * alignment()
Definition alignment.C:1
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:42
virtual void SetTextFont(Font_t tfont=62)
Set the text font.
Definition TAttText.h:46
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition TAttText.h:47
The Canvas class.
Definition TCanvas.h:23
To draw Mathematical Formula.
Definition TLatex.h:18
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
Definition TLatex.cxx:1928
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
Definition TPad.h:331
TH1F * DrawFrame(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, const char *title="") override
Draw an empty pad frame with X and Y axis.
Definition TPad.cxx:1582