Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f751eda

Browse files
authored
Merge pull request #16559 from Carreau/3d-no-gca
3D example avoid using statefull .gca()
2 parents b3e6248 + 24d6b64 commit f751eda

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)