SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: <pat...@at...> - 2011年01月27日 04:53:23
Forgive me if this is an old question, but I just loaded mplot3d and was
attempting to work through a couple of the examples on the Matplotlib
website. The problem is that whenever I try to make a call to a function
that requires an argument of projection='3d' (such as: ax =
fig.add_subplot(111, projection='3d')), Python gives me the following error:
 
Traceback (most recent call last):
 File "<pyshell#12>", line 1, in <module>
 ax = fig.add_subplot(111, projection='3d')
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 677, in
add_subplot
 projection_class = get_projection_class(projection)
 File "C:\Python26\lib\site-packages\matplotlib\projections\__init__.py",
line 61, in get_projection_class
 raise ValueError("Unknown projection '%s'" % projection)
ValueError: Unknown projection '3d'
 
Running help on fig.add_subplot does not show '3d' as a valid projection
type for this function.
 
What's going on, and how do I fix it?
 
I'm running Python 2.6.6 on Windows 7.
 
Thanks in advance.
 
/s/
Pat
From: Thomas L. <thl...@ms...> - 2011年01月28日 15:09:06
From: patbradf
To: mat...@li...
Date: 2011年1月26日 22:53:28 -0600
Subject: [Matplotlib-users] Problem with "projection='3d'"
Forgive me if this is an old question, but I just loaded mplot3d and was attempting to work through a couple of the examples on the Matplotlib website. The problem is that whenever I try to make a call to a function that requires an argument of projection=’3d’ (such as: ax = fig.add_subplot(111, projection='3d')), Python gives me the following error: Traceback (most recent call last): File "<pyshell#12>", line 1, in <module> ax = fig.add_subplot(111, projection='3d') File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 677, in add_subplot projection_class = get_projection_class(projection) File "C:\Python26\lib\site-packages\matplotlib\projections\__init__.py", line 61, in get_projection_class raise ValueError("Unknown projection '%s'" % projection)ValueError: Unknown projection '3d'
Check the version of matplotlib you have ! , I suspect a <=1.0
HTH
Thom
 		 	 		 
From: Benjamin R. <ben...@ou...> - 2011年01月28日 20:31:15
On Friday, January 28, 2011, Thomas Lecocq <thl...@ms...> wrote:
>
>
>
>
>
>
> From: patbradf
> To: mat...@li...
> Date: 2011年1月26日 22:53:28 -0600
> Subject: [Matplotlib-users] Problem with "projection='3d'"
>
> Forgive me if this is an old question, but I just loaded mplot3d and was attempting to work through a couple of the examples on the Matplotlib website. The problem is that whenever I try to make a call to a function that requires an argument of projection=’3d’ (such as:  ax = fig.add_subplot(111, projection='3d')), Python gives me the following error: Traceback (most recent call last): File "<pyshell#12>", line 1, in <module>  ax = fig.add_subplot(111, projection='3d') File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 677, in add_subplot  projection_class = get_projection_class(projection) File "C:\Python26\lib\site-packages\matplotlib\projections\__init__.py", line 61, in get_projection_class  raise ValueError("Unknown projection '%s'" % projection)ValueError: Unknown projection '3d'
>
> Check the version of matplotlib you have ! , I suspect a <=1.0
> HTH
> Thom
> 		 	 		
>
If your version is less than 1.0, the the 3D examples will not work as
is. Instead of gca() with the projection argument, you need to make
an Axes3D object instead.
fig = plt.figure()
ax = Axes3D(fig)
Or something like that (I am working off memory right now).
Ben Root
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /