Hi – this is my first post to such a list, so bear
I’ve just installed mpl3d and have had success with
the examples shown at http://www.scipy.org/Cookbook/Matplotlib/mplot3D
We currently don’t have numpy installed and using the
older Numeric, so I used the following instead:
N = 100
x = zeros((N,N),Float)
y = zeros((N,N),Float)
z = zeros((N,N),Float)
u = arange(0,2*pi,2.*pi/N)
v = arange(0,2*pi,2.*pi/N)
for i in range(N):
for j in range(N): x[i,j] = cos(u[i])*sin(v[j]) y[i,j] = sin(u[i])*sin(v[j]) z[i,j] = cos(v[j])
ax = p3.Axes3D(fig)
which worked a treat (apart from the figure not closing on
the first instance …).
However, if I change N to 10, I get the following error
Traceback (most recent call last):
File “test.py”, line 47, in ?
line 921, in plot_surface
norm = normalize(min(shade),max(shade))
ValueError: min() arg is an empty sequence
It seems that if the number of columns or rows is less than
20 than rstride and cstride = 0. This means that the boxes required to make the
polygons in the surface plot won’t be constructed. However, you can get a
3D plot if you use plot_wireframe or plot3D instead with N = 10 (but these
plots aren’t quite as nice as the surface plot would be).
Is there a minimum size of the arrays which plot_surface
will work on? Is there a workaround for smaller examples? I’m looking at
plotting a (smallish) number of time series solutions as a surface.
Dr Jane * ** * Sexton****
and Earth Monitoring Division