]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxPlotCanvas.py
2 from wxPython
.lib
.wxPlotCanvas
import *
3 from wxPython
.lib
import wxPlotCanvas
5 #---------------------------------------------------------------------------
8 # 100 points sin function, plotted as green circles
9 data1
= 2.*Numeric
.pi
*Numeric
.arange(200)/200.
10 data1
.shape
= (100, 2)
11 data1
[:,1] = Numeric
.sin(data1
[:,0])
12 markers1
= PolyMarker(data1
, color
='green', marker
='circle',size
=1)
14 # 50 points cos function, plotted as red line
15 data1
= 2.*Numeric
.pi
*Numeric
.arange(100)/100.
17 data1
[:,1] = Numeric
.cos(data1
[:,0])
18 lines
= PolyLine(data1
, color
='red')
20 # A few more points...
22 markers2
= PolyMarker([(0., 0.), (pi
/4., 1.), (pi
/2, 0.),
23 (3.*pi
/4., -1)], color
='blue',
24 fillcolor
='green', marker
='cross')
26 return PlotGraphics([markers1
, lines
, markers2
])
29 #---------------------------------------------------------------------------
32 def runTest(frame
, nb
, log
):
34 win
.draw(_InitObjects(),'automatic','automatic');
37 overview
= wxPlotCanvas
.__doc
__
39 #---------------------------------------------------------------------------
44 if __name__
== '__main__':
47 run
.main(['', os
.path
.basename(sys
.argv
[0])])