ROOT
Version v6.32
master
v6.34
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
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
graphpolar2.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphs
3
/// \notebook
4
/// Create and draw a polar graph with PI axis
5
///
6
/// \macro_image
7
/// \macro_code
8
///
9
/// \author Olivier Couet
10
11
void
graphpolar2
()
12
{
13
TCanvas
*
CPol
=
new
TCanvas
(
"CPol"
,
"TGraphPolar Example"
,500,500);
14
15
Double_t
theta[8];
16
Double_t
radius
[8];
17
Double_t
etheta
[8];
18
Double_t
eradius
[8];
19
20
for
(
int
i=0; i<8; i++) {
21
theta[i] = (i+1)*(
TMath::Pi
()/4.);
22
radius
[i] = (i+1)*0.05;
23
etheta
[i] =
TMath::Pi
()/8.;
24
eradius
[i] = 0.05;
25
}
26
27
TGraphPolar
*
grP1
=
new
TGraphPolar
(8, theta,
radius
,
etheta
,
eradius
);
28
grP1
->SetTitle(
""
);
29
30
grP1
->SetMarkerStyle(20);
31
grP1
->SetMarkerSize(2.);
32
grP1
->SetMarkerColor(4);
33
grP1
->SetLineColor(2);
34
grP1
->SetLineWidth(3);
35
grP1
->Draw(
"PE"
);
36
37
CPol
->Update();
38
39
if
(
grP1
->GetPolargram())
40
grP1
->GetPolargram()->SetToRadian();
41
}
Double_t
double Double_t
Definition
RtypesCore.h:59
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TGraphPolar
To draw a polar graph.
Definition
TGraphPolar.h:23
TMath::Pi
constexpr Double_t Pi()
Definition
TMath.h:37
tutorials
graphs
graphpolar2.C
ROOT v6-32 - Reference Guide Generated on Sat Apr 5 2025 05:36:20 (GVA Time) using Doxygen 1.10.0