From 1edba77ecf5bfd473b1a5c2203e0dd7340cdf62f Mon Sep 17 00:00:00 2001 From: flash631 Date: Wed, 8 Apr 2026 17:18:20 -0500 Subject: [PATCH] Fix Step 5 3D plotting for modern Matplotlib --- lessons/07_Step_5.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lessons/07_Step_5.ipynb b/lessons/07_Step_5.ipynb index 1d3bfa8e..18e4e7c1 100644 --- a/lessons/07_Step_5.ipynb +++ b/lessons/07_Step_5.ipynb @@ -148,7 +148,7 @@ "###Plot Initial Condition\n", "##the figsize parameter can be used to produce different sized images\n", "fig = pyplot.figure(figsize=(11, 7), dpi=100)\n", - "ax = fig.gca(projection='3d') \n", + "ax = fig.add_subplot(projection='3d') \n", "X, Y = numpy.meshgrid(x, y) \n", "surf = ax.plot_surface(X, Y, u[:], cmap=cm.viridis)\n", "\n" @@ -188,7 +188,7 @@ "source": [ "```python\n", "fig = pyplot.figure(figsize=(11, 7), dpi=100)\n", - "ax = fig.gca(projection='3d')\n", + "ax = fig.add_subplot(projection='3d')\n", "surf2 = ax.plot_surface(X, Y, u[:])\n", "```" ] @@ -271,7 +271,7 @@ " u[:, -1] = 1\n", "\n", "fig = pyplot.figure(figsize=(11, 7), dpi=100)\n", - "ax = fig.gca(projection='3d')\n", + "ax = fig.add_subplot(projection='3d')\n", "surf2 = ax.plot_surface(X, Y, u[:], cmap=cm.viridis)" ] }, @@ -317,7 +317,7 @@ " u[:, -1] = 1\n", "\n", "fig = pyplot.figure(figsize=(11, 7), dpi=100)\n", - "ax = fig.gca(projection='3d')\n", + "ax = fig.add_subplot(projection='3d')\n", "surf2 = ax.plot_surface(X, Y, u[:], cmap=cm.viridis)\n", "\n", " "