ROOT
v6-30
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
5
TLine
lv
;
6
lv
.
SetLineStyle
(3);
7
lv
.
SetLineColor
(
kBlue
);
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
@ kBlue
Definition
Rtypes.h:66
TAttLine::SetLineStyle
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition
TAttLine.h:42
TAttLine::SetLineColor
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition
TAttLine.h:40
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TLine
Use the TLine constructor to create a simple line.
Definition
TLine.h:22
TLine::DrawLine
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
TText
Base class for several text objects.
Definition
TText.h:22
th3
auto * th3
Definition
textalign.C:22
lv
TLine lv
Definition
textalign.C:5
tv3
auto * tv3
Definition
textalign.C:35
th2
auto * th2
Definition
textalign.C:18
tv1
auto * tv1
Definition
textalign.C:27
tv2
auto * tv2
Definition
textalign.C:31
th1
auto * th1
Definition
textalign.C:14
core
base
doc
macros
textalign.C
ROOT v6-30 - Reference Guide Generated on Sun Dec 1 2024 05:17:14 (GVA Time) using Doxygen 1.9.8