ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
macro3.py
Go to the documentation of this file.
1
# Builds a polar graph in a square Canvas.
2
3
from
ROOT
import
TGraphPolar, TCanvas, TMath
4
from
array
import
array
5
6
c =
TCanvas
(
"myCanvas"
,
"myCanvas"
,600,600)
7
rmin = 0.
8
rmax =
TMath.Pi
()*6.
9
npoints = 300
10
r = array(
'd'
,[0]*npoints)
11
theta = array(
'd'
,[0]*npoints)
12
for
ipt
in
xrange(0,npoints):
13
r[ipt] = ipt*(rmax-rmin)/npoints+rmin
14
theta[ipt] =
TMath.Sin
(r[ipt])
15
16
grP1 =
TGraphPolar
(npoints,r,theta)
17
grP1.SetTitle(
"A Fan"
)
18
grP1.SetLineWidth(3)
19
grP1.SetLineColor(2)
20
grP1.DrawClone(
"L"
)
21
raw_input(
"Press enter to exit."
)
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:40
TMath::Sin
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition
TMath.h:599
documentation
primer
macros
macro3.py
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1