Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Simplify import statement #1009

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

bev-a-tron commented Jul 13, 2012

While doing the mplot3D tutorial, I found this import statement confusing. Axes3D is not needed specifically for the script to work.

Member

WeatherGod commented Jul 14, 2012

No, it is in the documentation. importing the Axes3D object is the only consistent way to guarantee that the Axes3D object gets "registered" with matplotlib. It is only because there are other mplot3d imports in this example that it may appear unneeded. However, taking it out would confuse newcomers who have read that in order to use Axes3D with mpl core, that they have to import Axes3D.

Closing.

@WeatherGod WeatherGod closed this Jul 14, 2012

Contributor

bev-a-tron commented Jul 14, 2012

In the init file for mplot3d, there is one line: from axes3d import Axes3D
So, it does get imported when mplot3d is imported.

Member

WeatherGod commented Jul 15, 2012

Perhaps I was too hasty. I am still not convinced that your change is much
of an improvement under your rationale, but I do see your point. There is
a legacy reason for this because it was only a couple of releases ago that
we were able to do "projection='3d'". Before that, you actually did need
to import Axes3d and use that object directly.

If this change happens, it would be best if it were consistently changed
across all docs and examples. I am not inclined to make such a change, but
I wouldn't get in the way of it if it was done across the board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment