|
2 | 2 |
|
3 | 3 | import matplotlib
|
4 | 4 | matplotlib.use('WXAgg')
|
5 |
| -matplotlib.rcParams['numerix'] = 'numarray' |
| 5 | +matplotlib.rcParams['numerix'] = 'numpy' |
6 | 6 |
|
7 | 7 | from wxPython.wx import *
|
8 | 8 | import matplotlib.axes3d
|
@@ -38,16 +38,18 @@ def plot3d(self):
|
38 | 38 | ax3d = matplotlib.axes3d.Axes3D(self.fig)
|
39 | 39 | plt = self.fig.axes.append(ax3d)
|
40 | 40 |
|
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) |
44 | 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)) |
| 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 |
48 | 49 |
|
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)) |
51 | 53 |
|
52 | 54 | ax3d.set_xlabel('X')
|
53 | 55 | ax3d.set_ylabel('Y')
|
|
0 commit comments