File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77from wxPython .wx import *
88import matplotlib .axes3d
9+ from matplotlib import numerix as nx
910from matplotlib .figure import Figure
1011from matplotlib .backends .backend_wxagg import FigureCanvasWxAgg , FigureManager , NavigationToolbar2WxAgg
1112
@@ -33,9 +34,23 @@ def __init__(self):
3334 self .plot3d ()
3435
3536 def plot3d (self ):
37+ # sample taken from http://www.scipy.org/Cookbook/Matplotlib/mplot3D
3638 ax3d = matplotlib .axes3d .Axes3D (self .fig )
3739 plt = self .fig .axes .append (ax3d )
3840
41+ delta = nx .pi / 100.0
42+ u = nx .arange (0 , 2 * nx .pi + delta , delta )
43+ v = nx .arange (0 , nx .pi + delta , delta )
44+
45+ x = 10 * nx .outerproduct (nx .cos (u ),nx .sin (v ))
46+ y = 10 * nx .outerproduct (nx .sin (u ),nx .sin (v ))
47+ z = 10 * nx .outerproduct (nx .ones (nx .size (u )),nx .cos (v ))
48+
49+ ax3d .plot_wireframe (x ,y ,z )
50+ ax3d .set_xlabel ('X' )
51+ ax3d .set_ylabel ('Y' )
52+ ax3d .set_zlabel ('Z' )
53+
3954if __name__ == '__main__' :
4055 app = wxPySimpleApp (0 )
4156 frame = PlotFigure ()
You can’t perform that action at this time.
0 commit comments