I'm using matplotlib 1.0.1.  I have the following simple script to plot a
surface:

-----
from numpy import linspace, sin, cos, meshgrid

from matplotlib.pyplot import figure, show, xlabel, ylabel
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D

n = 35
x = linspace(-5, 5, n)
y = linspace(0, 10, n)
X, Y = meshgrid(x, y)
Z = X*sin(X)*cos(0.25*Y)

fig = figure()
ax = fig.gca(projection='3d')
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.copper)
xlabel('x')
ylabel('y')
show()
-----

It works fine--many thanks to all the folks working on the 3D plots!

But notice that Axes3D is imported from matplotlib.mplot3d, but never
explicitly used.  If I comment out that import, however, I get the following
traceback:
-----
Traceback (most recent call last):
  File "surf_demo.py", line 15, in <module>
    ax = fig.gca(projection='3d')
  File
"/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/figure.py",
line 965, in gca
    return self.add_subplot(111, **kwargs)
  File
"/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/figure.py",
line 675, in add_subplot
    projection_class = get_projection_class(projection)
  File
"/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/projections/__init__.py",
line 61, in get_projection_class
    raise ValueError("Unknown projection '%s'" % projection)
ValueError: Unknown projection '3d'
-----

Is this expected?

Warren
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to