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

Skip to content

Commit 7bf4308

Browse files
committed
svn path=/trunk/matplotlib/; revision=2514
1 parent 020e0bf commit 7bf4308

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

examples/simple3d_oo.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import matplotlib
44
matplotlib.use('WXAgg')
5-
matplotlib.rcParams['numerix'] = 'numarray'
5+
matplotlib.rcParams['numerix'] = 'numpy'
66

77
from wxPython.wx import *
88
import matplotlib.axes3d
@@ -38,16 +38,18 @@ def plot3d(self):
3838
ax3d = matplotlib.axes3d.Axes3D(self.fig)
3939
plt = self.fig.axes.append(ax3d)
4040

41-
delta = nx.pi / 100.0
42-
u = nx.arange(0, 2*nx.pi, delta)
43-
v = nx.arange(0, nx.pi, delta)
41+
delta = nx.pi / 99.0
42+
u = nx.arange(0, 2*nx.pi+(delta*2), delta*2)
43+
v = nx.arange(0, nx.pi+delta, delta)
4444

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))
45+
x=nx.outerproduct(nx.cos(u),nx.sin(v))
46+
y=nx.outerproduct(nx.sin(u),nx.sin(v))
47+
z=nx.outerproduct(nx.ones(nx.size(u)), nx.cos(v))
48+
print x.shape, y.shape, z.shape
4849

49-
ax3d.plot_wireframe(x,y,z)
50-
ax3d.plot_surface(x+10,y,z)
50+
#ax3d.plot_wireframe(x,y,z)
51+
surf = ax3d.plot_surface(x, y, z)
52+
surf.set_array(nx.arange(0, 1.0, 1/100.0))
5153

5254
ax3d.set_xlabel('X')
5355
ax3d.set_ylabel('Y')

0 commit comments

Comments
 (0)