New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pathpatch3d_demo.py on Python 3 #981
Conversation
@@ -1,14 +1,13 @@ | |||
import matplotlib.pyplot as plt | |||
from matplotlib.patches import Circle, PathPatch | |||
from mpl_toolkits.mplot3d import Axes3D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this needed to register the 3d projection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not used anywhere in the file. Does the import have a side effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From memory yes. I think it registers the projection with matplotlib. Presumably the code still runs as there are other 3d imports, but this particular import should remain and should be explicitly commented as to why it is there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, Thanks. I'll work on the remaining issues tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is needed there. By importing Axes3D, the Axes3D class gets registered with the rest of matplotlib and it allows for more seamless integration with the rest of mpl. This is fully documented in the mplot3d documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, yes, because of the other mplot3d imports there, removing that line still works, but I would rather keep everything consistent with the documentation.
Out of interest, what was broken in Python 3 with this example? |
|
heh, never knew it was possible to do that. Looks like 3.0 removed that feature. Good thing I never learned that hideous syntax. |
Fix pathpatch3d_demo.py on Python 3
No description provided.