Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
lineset.py
Go to the documentation of this file.
1## Translated from 'lineset.C'.
2## Run as: python -i lineset.py
3
4import ROOT
5ROOT.PyConfig.GUIThreadScheduleOnce += [ ROOT.TEveManager.Create ]
6
7def lineset(nlines = 40, nmarkers = 4):
8 r = ROOT.TRandom(0)
9 s = 100
10
11 ls = ROOT.TEveStraightLineSet()
12
13 for i in range(nlines):
14 ls.AddLine( r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s) ,
15 r.Uniform(-s,s), r.Uniform(-s,s), r.Uniform(-s,s))
16 nm = int(nmarkers*r.Rndm())
17 for m in range(nm):
18 ls.AddMarker( i, r.Rndm() )
19 ls.SetMarkerSize(1.5)
20 ls.SetMarkerStyle(4)
21
22 ROOT.gEve.AddElement(ls)
23 ROOT.gEve.Redraw3D()
24 return ls
25
26if __name__=='__main__':
27 ROOT.PyGUIThread.finishSchedule()
28 lineset()