ROOT
Version v6.34
master
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
▼
Functional Parts
►
Core ROOT classes
►
std Extension classes
►
Parallelized classes
►
The Geometry Package
►
Graphics
►
Event display with ROOT7
►
GUI
►
Web Widgets
►
Web Display
►
Histogram Library
►
Input/Output Library
►
Math
►
N-D parametric functions
►
VecOps
►
Monte Carlo
►
HTTP server
►
PROOF
►
TMVA
►
RooFit
►
Dataframe
►
ROOT7 classes
►
NTuple-related classes
►
Tree Library
►
TreePlayer Library
▼
Tutorials
►
Histograms tutorials
►
Tree tutorials
►
Dataframe tutorials
►
ROOT 7 tutorials
►
FOAM tutorials
►
Containers tutorials
►
Event display tutorials
►
Event display ROOT7 tutorials
►
Geometry tutorials
►
Fast Fourier Transforms tutorials
►
Fit Tutorials
►
RooFit Tutorials
▼
Graphs tutorials
annotation3d.C
approx.C
bent.C
bent.py
exclusiongraph.C
exclusiongraph2.C
gerrors.C
gerrors2.C
gmultierrors.C
graph.C
graph2derrorsfit.C
graphApply.C
graphpalettecolor.C
graphpolar.C
graphpolar2.C
graphpolar3.C
graphreverse.C
graphShade.C
graphstruct.C
graphtext.C
gtime.C
gtime2.C
hlGraph1.C
hlGraph2.C
labels1.C
labels2.C
motorcycle.C
multigraph.C
multigraphpalettecolor.C
multipalette.C
scatter.C
seism.C
splines_test.C
surfaces.C
timeonaxis.C
timeonaxis2.C
timeonaxis3.C
timeSeriesFromCSV.C
timeSeriesFromCSV.py
timeSeriesFromCSV_TDF.C
waves.C
zdemo.C
zones.C
zones.py
►
Graphics tutorials
►
OpenGL tutorials
►
Tutorials specific to Mac/Cocoa
►
GUI tutorials
►
HistFactory Tutorials
►
HTTP tutorials
►
Image tutorials
►
IO tutorials
►
Math tutorials
►
Matrix tutorials
►
Monte Carlo tutorials
►
Multicore tutorials
►
Net tutorials
►
Physics tutorials
►
PyRoot tutorials
►
Pythia tutorials
►
Quadratic programming package.
►
R tutorials
►
RooStats Tutorials
►
Spectrum tutorials
►
TSPlot tutorials
►
SQL tutorials
►
TMVA tutorials
►
TUnfold tutorials
►
Unuran tutorials
►
VecOps tutorials
►
FITS files interface tutorials
►
XML tutorials
►
Proof tutorials
►
TWebCanvas tutorials
►
Webgui tutorials
►
Legacy tutorials
demos.C
demoshelp.C
hsimple.C
rootlogoff.C
rootlogon.C
►
R Interface for Statistical Computing
►
Namespaces
►
All Classes
►
Files
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
labels2.C File Reference
Tutorials
»
Graphs tutorials
Detailed Description
Setting alphanumeric labels.
void
labels2
()
{
Int_t
i;
const
Int_t
nx
= 12;
const
Int_t
ny
= 20;
const
char
*
month
[
nx
] = {
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
const
char
*
people
[
ny
] = {
"Jean"
,
"Pierre"
,
"Marie"
,
"Odile"
,
"Sebastien"
,
"Fons"
,
"Rene"
,
"Nicolas"
,
"Xavier"
,
"Greg"
,
"Bjarne"
,
"Anton"
,
"Otto"
,
"Eddy"
,
"Peter"
,
"Pasha"
,
"Philippe"
,
"Suzanne"
,
"Jeff"
,
"Valery"
};
TCanvas
*
c1
=
new
TCanvas
(
"c1"
,
"demo bin labels"
,
10,10,800,800);
c1
->SetGrid();
c1
->SetLeftMargin(0.15);
c1
->SetBottomMargin(0.15);
TH2F
*
h
=
new
TH2F
(
"h"
,
"test"
,
nx
,0,
nx
,
ny
,0,
ny
);
for
(i=0;i<5000;i++) {
h
->Fill(
gRandom
->
Gaus
(0.5*
nx
,0.2*
nx
),
gRandom
->
Gaus
(0.5*
ny
,0.2*
ny
));
}
h
->SetStats(0);
for
(i=1;i<=
nx
;i++)
h
->GetXaxis()->SetBinLabel(i,
month
[i-1]);
for
(i=1;i<=
ny
;i++)
h
->GetYaxis()->SetBinLabel(i,
people
[i-1]);
h
->Draw(
"text"
);
TPaveText
*
pt
=
new
TPaveText
(0.6,0.85,0.98,0.98,
"brNDC"
);
pt
->
SetFillColor
(18);
pt
->
SetTextAlign
(12);
pt
->
AddText
(
"Use the axis Context Menu LabelsOption"
);
pt
->
AddText
(
" \"a\" to sort by alphabetic order"
);
pt
->
AddText
(
" \">\" to sort by decreasing values"
);
pt
->
AddText
(
" \"<\" to sort by increasing values"
);
pt
->
Draw
();
}
h
#define h(i)
Definition
RSha256.hxx:106
Int_t
int Int_t
Definition
RtypesCore.h:45
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
gRandom
R__EXTERN TRandom * gRandom
Definition
TRandom.h:62
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TAttFill::SetFillColor
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition
TAttFill.h:37
TAttText::SetTextAlign
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition
TAttText.h:42
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TH2F
2-D histogram with a float per channel (see TH1 documentation)
Definition
TH2.h:307
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition
TPaveText.h:21
TPaveText::AddText
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition
TPaveText.cxx:191
TPaveText::Draw
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
Definition
TPaveText.cxx:242
TRandom::Gaus
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition
TRandom.cxx:275
pt
TPaveText * pt
Definition
entrylist_figure1.C:7
c1
return c1
Definition
legend1.C:41
Author
Rene Brun
Definition in file
labels2.C
.
tutorials
graphs
labels2.C
ROOT tags/6-34-04 - Reference Guide Generated on Wed Mar 26 2025 04:46:35 (GVA Time) using Doxygen 1.10.0