Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 606ddd6

Browse files
committed
svn path=/trunk/matplotlib/; revision=2506
1 parent 2fb1f36 commit 606ddd6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

examples/simple3d_oo.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from wxPython.wx import *
88
import matplotlib.axes3d
9+
from matplotlib import numerix as nx
910
from matplotlib.figure import Figure
1011
from 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+
3954
if __name__ == '__main__':
4055
app = wxPySimpleApp(0)
4156
frame = PlotFigure()

0 commit comments

Comments
 (0)