Loading [MathJax]/extensions/tex2jax.js
ROOT
6.06/09
Reference Guide
ROOT Home Page
Main Page
Related Pages
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
Modules
Pages
graf2d
graf
doc
macros
legend3.C
Go to the documentation of this file.
1
{
2
TCanvas
*c3 =
new
TCanvas
(
"c2"
,
"c2"
,500,300);
3
4
TLegend
* leg =
new
TLegend
(0.2, 0.2, .8, .8);
5
TH1
* h =
new
TH1F
(
""
,
""
, 1, 0, 1);
6
7
leg->
SetNColumns
(2);
8
9
leg->
AddEntry
(h,
"Column 1 line 1"
,
"l"
);
10
leg->
AddEntry
(h,
"Column 2 line 1"
,
"l"
);
11
leg->
AddEntry
(h,
"Column 1 line 2"
,
"l"
);
12
leg->
AddEntry
(h,
"Column 2 line 2"
,
"l"
);
13
14
leg->
Draw
();
15
return
c3
;
16
}
17
TLegend
This class displays a legend box (TPaveText) containing several legend entries.
Definition:
TLegend.h:35
TLegend::Draw
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
Definition:
TLegend.cxx:373
ROOT::TH1F
THist< 1, float > TH1F
Definition:
THist.h:315
SetNColumns
leg SetNColumns(2)
TCanvas
The Canvas class.
Definition:
TCanvas.h:48
TLegend::AddEntry
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
Definition:
TLegend.cxx:280
TH1
The TH1 histogram class.
Definition:
TH1.h:80
c3
return c3
Definition:
legend3.C:15