Tornado example.
from ROOT import TCanvas, TView, TPolyMarker3D, TPaveText
from ROOT import gROOT, gBenchmark
from math import cos, sin, pi
gBenchmark.Start( 'tornado' )
d = 16
numberOfPoints = 200
numberOfCircles = 40
sky =
TCanvas(
'sky',
'Tornado', 300, 10, 700, 500 )
sky.SetFillColor( 14 )
rng = numberOfCircles * d
view.SetRange( 0, 0, 0, 4.0*rng, 2.0*rng, rng )
polymarkers = []
for j in range( d, numberOfCircles * d, d ):
for i in range( 1, numberOfPoints ) :
csin = sin( 2*pi / numberOfPoints * i ) + 1
ccos = cos( 2*pi / numberOfPoints * i ) + 1
esin = sin( 2*pi / (numberOfCircles*d) * j ) + 1
x = j * ( csin + esin );
y = j * ccos;
z = j;
pm3d.SetPoint( i, x, y, z );
pm3d.SetMarkerSize( 1 )
pm3d.SetMarkerColor( 2 + ( d == ( j & d ) ) )
pm3d.SetMarkerStyle( 3 )
pm3d.Draw()
polymarkers.append( pm3d )
gBenchmark.Show( 'tornado' )
ct = gBenchmark.GetCpuTime( 'tornado' )
timeStr = 'Execution time: %g sec.' % ct
text.SetFillColor( 42 )
text.AddText( 'PyROOT example: tornado.py' )
text.AddText( timeStr )
text.Draw()
sky.Update()
A Pave (see TPave) with text, lines or/and boxes inside.
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.