]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/PlotCanvas.py
3 # wx.lib.wxPlotCanvas is deprecated. Use wx.lib.plot instead.
7 import wx
.lib
.wxPlotCanvas
as plot
11 #---------------------------------------------------------------------------
14 # 100 points sin function, plotted as green circles
15 data1
= 2.*Numeric
.pi
*Numeric
.arange(200)/200.
16 data1
.shape
= (100, 2)
17 data1
[:,1] = Numeric
.sin(data1
[:,0])
18 markers1
= plot
.PolyMarker(data1
, color
='green', marker
='circle',size
=1)
20 # 50 points cos function, plotted as red line
21 data1
= 2.*Numeric
.pi
*Numeric
.arange(100)/100.
23 data1
[:,1] = Numeric
.cos(data1
[:,0])
24 lines
= plot
.PolyLine(data1
, color
='red')
26 # A few more points...
28 markers2
= plot
.PolyMarker([(0., 0.), (pi
/4., 1.), (pi
/2, 0.),
29 (3.*pi
/4., -1)], color
='blue',
30 fillcolor
='green', marker
='cross')
32 return plot
.PlotGraphics([markers1
, lines
, markers2
])
35 #---------------------------------------------------------------------------
38 def runTest(frame
, nb
, log
):
39 win
= plot
.PlotCanvas(nb
)
40 win
.draw(_InitObjects(),'automatic','automatic');
43 overview
= plot
.__doc
__
45 #---------------------------------------------------------------------------
48 if __name__
== '__main__':
51 run
.main(['', os
.path
.basename(sys
.argv
[0])])