ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
pavetext.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// \notebook
4
/// Draw a pave text.
5
/// The text lines are added in order using the AddText method
6
/// Line separator can be added using AddLine.
7
///
8
/// AddText returns a TText corresponding to the line added to the pave. This
9
/// return value can be used to modify the text attributes.
10
///
11
/// Once the TPaveText is build the text of each line can be retrieved as a
12
/// TText with GetLine and GetLineWith wich is also useful to modify the text
13
/// attributes of a line.
14
///
15
/// \macro_image
16
/// \macro_code
17
///
18
/// \author Olivier Couet
19
20
TCanvas
*pavetext(){
21
TCanvas
*
c
=
new
TCanvas
(
"c"
);
22
TPaveText
*
pt
=
new
TPaveText
(.05,.1,.95,.8);
23
24
pt
->AddText(
"A TPaveText can contain severals line of text."
);
25
pt
->AddText(
"They are added to the pave using the AddText method."
);
26
pt
->AddLine(.0,.5,1.,.5);
27
pt
->AddText(
"Even complex TLatex formulas can be added:"
);
28
TText
*
t1
=
pt
->AddText(
"F(t) = #sum_{i=-#infty}^{#infty}A(i)cos#[]{#frac{i}{t+i}}"
);
29
30
t1
->SetTextColor(
kBlue
);
31
32
pt
->Draw();
33
34
TText
*t2 =
pt
->GetLineWith(
"Even"
);
35
t2->
SetTextColor
(
kOrange
+1);
36
37
return
c
;
38
}
c
#define c(i)
Definition
RSha256.hxx:101
kOrange
@ kOrange
Definition
Rtypes.h:67
kBlue
@ kBlue
Definition
Rtypes.h:66
TAttText::SetTextColor
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition
TAttText.h:44
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition
TPaveText.h:21
TText
Base class for several text objects.
Definition
TText.h:22
pt
TPaveText * pt
Definition
entrylist_figure1.C:7
t1
auto * t1
Definition
textangle.C:20
tutorials
graphics
pavetext.C
ROOT v6-32 - Reference Guide Generated on Tue May 19 2026 02:47:09 (GVA Time) using Doxygen 1.13.2