Skip to content

Commit 24d6b64

Browse files
author
Matthias Bussonnier
committed
3D example avoid using statefull .gca()
explicit is better than implicit, gca is not explicit
1 parent cffff13 commit 24d6b64

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/mplot3d/surface3d.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
from matplotlib.ticker import LinearLocator, FormatStrFormatter
1616
import numpy as np
1717

18-
19-
fig = plt.figure()
20-
ax = fig.gca(projection='3d')
18+
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
2119

2220
# Make data.
2321
X = np.arange(-5, 5, 0.25)

0 commit comments

Comments
 (0)