ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tutorials
graphics
first.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// Show some basic primitives.
4
///
5
/// \macro_image
6
/// \macro_code
7
///
8
/// \author Rene Brun
9
10
void
first
() {
11
12
TCanvas
*nut =
new
TCanvas
(
"nut"
,
"FirstSession"
,100,10,700,900);
13
nut->
Range
(0,0,20,24);
14
nut->
SetFillColor
(10);
15
nut->
SetBorderSize
(2);
16
17
TPaveLabel
*pl =
new
TPaveLabel
(3,22,17,23.7,
18
"My first ROOT interactive session"
,
"br"
);
19
pl->
SetFillColor
(18);
20
pl->
Draw
();
21
22
TText
t
(0,0,
"a"
);
23
t
.SetTextFont(62);
24
t
.SetTextSize(0.025);
25
t
.SetTextAlign(12);
26
t
.DrawText(2,20.3,
"ROOT is based on CINT, a powerful C/C++ interpreter."
);
27
t
.DrawText(2,19.3,
"Blocks of lines can be entered within {...}."
);
28
t
.DrawText(2,18.3,
"Previous typed lines can be recalled."
);
29
30
t
.SetTextFont(72);
31
t
.SetTextSize(0.026);
32
t
.DrawText(3,17,
"Root > float x=5; float y=7;"
);
33
t
.DrawText(3,16,
"Root > x*sqrt(y)"
);
34
t
.DrawText(3,14,
35
"Root > for (int i=2;i<7;i++) printf(\"sqrt(%d) = %f\\n\",i,sqrt(i));"
);
36
t
.DrawText(3,10,
"Root > TF1 f1(\"f1\",\"sin(x)/x\",0,10)"
);
37
t
.DrawText(3, 9,
"Root > f1.Draw()"
);
38
t
.SetTextFont(81);
39
t
.SetTextSize(0.018);
40
t
.DrawText(4,15,
"(float) 13.2288f"
);
41
t
.DrawText(4,13.3,
"sqrt(2) = 1.414214"
);
42
t
.DrawText(4,12.7,
"sqrt(3) = 1.732051"
);
43
t
.DrawText(4,12.1,
"sqrt(4) = 2.000000"
);
44
t
.DrawText(4,11.5,
"sqrt(5) = 2.236068"
);
45
t
.DrawText(4,10.9,
"sqrt(6) = 2.449490"
);
46
47
TPad
*pad =
new
TPad
(
"pad"
,
"pad"
,.2,.05,.8,.35);
48
pad->
Draw
();
49
pad->
cd
();
50
pad->
SetGrid
();
51
TF1
*f1 =
new
TF1
(
"f1"
,
"sin(x)/x"
,0,10);
52
f1->
Draw
();
53
}
TF1::Draw
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
Definition:
TF1.cxx:1052
TPad::cd
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition:
TPad.cxx:514
TPad::SetGrid
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
Definition:
TPad.h:326
TText
Base class for several text objects.
Definition:
TText.h:42
TPad::Draw
virtual void Draw(Option_t *option="")
Draw Pad in Current pad (re-parent pad if necessary).
Definition:
TPad.cxx:1192
TPaveLabel
A Pave (see TPave) with a text centered in the Pave.
Definition:
TPaveLabel.h:32
t
TThread * t[5]
Definition:
threadsh1.C:13
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Definition:
TAttFill.h:50
TPad::Range
virtual void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Set world coordinate system for the pad.
Definition:
TPad.cxx:4623
TPad
The most important graphics class in the ROOT system.
Definition:
TPad.h:46
first
bool first
Definition:
line3Dfit.C:48
TCanvas
The Canvas class.
Definition:
TCanvas.h:48
TPaveLabel::Draw
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition:
TPaveLabel.cxx:77
TF1
1-Dim function class
Definition:
TF1.h:149
TPad::SetBorderSize
virtual void SetBorderSize(Short_t bordersize)
Definition:
TPad.h:317