Skip to content

Commit

Permalink
resolve deprecation warnings from matplotlib in docs scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jun 19, 2021
1 parent 5e0c52a commit 7bc0f26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion doc/source/cookbook/streamlines.py
Expand Up @@ -33,7 +33,9 @@

# Create a 3D plot, trace the streamlines through the 3D volume of the plot
fig = plt.figure()
ax = Axes3D(fig)
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)

for stream in streamlines.streamlines:
stream = stream[np.all(stream != 0.0, axis=1)]
ax.plot3D(stream[:, 0], stream[:, 1], stream[:, 2], alpha=0.1)
Expand Down
3 changes: 2 additions & 1 deletion doc/source/cookbook/streamlines_isocontour.py
Expand Up @@ -32,7 +32,8 @@

# Create a 3D matplotlib figure for visualizing the streamlines
fig = plt.figure()
ax = Axes3D(fig)
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)

# Trace the streamlines through the volume of the 3D figure
for stream in streamlines.streamlines:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/cookbook/surface_plot.py
Expand Up @@ -20,7 +20,7 @@

# Create a 3D matplotlib figure for visualizing the surface
fig = plt.figure()
ax = fig.gca(projection="3d")
ax = fig.add_subplot(projection="3d")
p3dc = Poly3DCollection(surface.triangles, linewidth=0.0)

# Set the surface colors in the right scaling [0,1]
Expand Down

0 comments on commit 7bc0f26

Please sign in to comment.