Skip to content

Commit 821b5ed

Browse files
committed
Register 3d projection by default.
Now that we always install mpl_toolkits, we may as well always register mplot3d and save an "apparently unused" import for the users.
1 parent 867c3dd commit 821b5ed

34 files changed

+9
-94
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mplot3d is always registered by default
2+
```````````````````````````````````````
3+
4+
It is not necessary to import mplot3d anymore to create 3d axes with
5+
``fig.add_subplot(111, projection="3d")``.

doc/users/next_whats_new/2019-01-06-shaded-voxels.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ The plot below shows how this affects the output.
1212

1313
import matplotlib.pyplot as plt
1414
import numpy as np
15-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
1615

1716
# prepare some coordinates
1817
x, y, z = np.indices((8, 8, 8))

examples/frontpage/3D.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
This example reproduces the frontpage 3D example.
77
88
"""
9-
# This import registers the 3D projection, but is otherwise unused.
10-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
119

1210
from matplotlib import cbook
1311
from matplotlib import cm

examples/mplot3d/2dcollections3d.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
selective axes of a 3D plot.
88
"""
99

10-
# This import registers the 3D projection, but is otherwise unused.
11-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
12-
1310
import numpy as np
1411
import matplotlib.pyplot as plt
1512

examples/mplot3d/3d_bars.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
import numpy as np
1212
import matplotlib.pyplot as plt
13-
# This import registers the 3D projection, but is otherwise unused.
14-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
1513

1614

1715
# setup the figure and axes

examples/mplot3d/bars3d.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
planes y=0, y=1, etc.
88
"""
99

10-
# This import registers the 3D projection, but is otherwise unused.
11-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
12-
1310
import matplotlib.pyplot as plt
1411
import numpy as np
1512

examples/mplot3d/custom_shaded_3d_surface.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
Demonstrates using custom hillshading in a 3D surface plot.
77
"""
88

9-
# This import registers the 3D projection, but is otherwise unused.
10-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
11-
129
from matplotlib import cbook
1310
from matplotlib import cm
1411
from matplotlib.colors import LightSource

examples/mplot3d/hist3d.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
Demo of a histogram for 2 dimensional data as a bar graph in 3D.
77
"""
88

9-
# This import registers the 3D projection, but is otherwise unused.
10-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
11-
129
import matplotlib.pyplot as plt
1310
import numpy as np
1411

examples/mplot3d/lines3d.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
This example demonstrates plotting a parametric curve in 3D.
77
'''
88

9-
# This import registers the 3D projection, but is otherwise unused.
10-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
11-
129
import numpy as np
1310
import matplotlib.pyplot as plt
1411

examples/mplot3d/lorenz_attractor.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import numpy as np
1717
import matplotlib.pyplot as plt
18-
# This import registers the 3D projection, but is otherwise unused.
19-
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
2018

2119

2220
def lorenz(x, y, z, s=10, r=28, b=2.667):

0 commit comments

Comments
 (0)