From 24d6b64122b9bbfe08e6410b089f2029c1ed474d Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Wed, 19 Feb 2020 11:06:50 -0800 Subject: [PATCH] 3D example avoid using statefull .gca() explicit is better than implicit, gca is not explicit --- examples/mplot3d/surface3d.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/mplot3d/surface3d.py b/examples/mplot3d/surface3d.py index cb715dd2e80b..e71ae2c73302 100644 --- a/examples/mplot3d/surface3d.py +++ b/examples/mplot3d/surface3d.py @@ -15,9 +15,7 @@ from matplotlib.ticker import LinearLocator, FormatStrFormatter import numpy as np - -fig = plt.figure() -ax = fig.gca(projection='3d') +fig, ax = plt.subplots(subplot_kw={"projection": "3d"}) # Make data. X = np.arange(-5, 5, 0.25)