Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Simplify import statement #1009

Closed
wants to merge 1 commit into from

2 participants

@bev-a-tron

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

@WeatherGod
Collaborator

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
@bev-a-tron

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

@WeatherGod
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2012
  1. @bev-a-tron

    Simplify import statement

    bev-a-tron authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  examples/mplot3d/scatter3d_demo.py
View
2  examples/mplot3d/scatter3d_demo.py
@@ -1,5 +1,5 @@
import numpy as np
-from mpl_toolkits.mplot3d import Axes3D
+import mpl_toolkits.mplot3d
import matplotlib.pyplot as plt
def randrange(n, vmin, vmax):
Something went wrong with that request. Please try again.