Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
textalign.C
Go to the documentation of this file.
1{
2 auto *Ta = new TCanvas("Ta","Ta",0,0,500,200);
3 Ta->Range(0,0,1,1);
4
8 lv.DrawLine(0.33,0.0,0.33,1.0);
9 lv.DrawLine(0.6,0.165,1.,0.165);
10 lv.DrawLine(0.6,0.493,1.,0.493);
11 lv.DrawLine(0.6,0.823,1.,0.823);
12
13 // Horizontal alignment.
14 auto *th1 = new TText(0.33,0.165,"Left adjusted");
15 th1->SetTextAlign(11); th1->SetTextSize(0.12);
16 th1->Draw();
17
18 auto *th2 = new TText(0.33,0.493,"Center adjusted");
19 th2->SetTextAlign(21); th2->SetTextSize(0.12);
20 th2->Draw();
21
22 auto *th3 = new TText(0.33,0.823,"Right adjusted");
23 th3->SetTextAlign(31); th3->SetTextSize(0.12);
24 th3->Draw();
25
26 // Vertical alignment.
27 auto *tv1 = new TText(0.66,0.165,"Bottom adjusted");
28 tv1->SetTextAlign(11); tv1->SetTextSize(0.12);
29 tv1->Draw();
30
31 auto *tv2 = new TText(0.66,0.493,"Center adjusted");
32 tv2->SetTextAlign(12); tv2->SetTextSize(0.12);
33 tv2->Draw();
34
35 auto *tv3 = new TText(0.66,0.823,"Top adjusted");
36 tv3->SetTextAlign(13); tv3->SetTextSize(0.12);
37 tv3->Draw();
38}
@ kBlue
Definition Rtypes.h:66
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition TAttLine.h:42
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition TAttLine.h:40
The Canvas class.
Definition TCanvas.h:23
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Definition TLine.cxx:103
Base class for several text objects.
Definition TText.h:22
auto * th3
Definition textalign.C:22
TLine lv
Definition textalign.C:5
auto * tv3
Definition textalign.C:35
auto * th2
Definition textalign.C:18
auto * tv1
Definition textalign.C:27
auto * tv2
Definition textalign.C:31
auto * th1
Definition textalign.C:14