Skip to content


Simplify import statement #1009

wants to merge 1 commit into from

2 participants


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

Matplotlib Developers member

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.


@WeatherGod WeatherGod closed this

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

Matplotlib Developers member
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 committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 examples/mplot3d/
2 examples/mplot3d/
@@ -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.