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

Skip to content

Backport PR #23772 on branch v3.6.x (3d plots what's new cleanups) #23773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/users/next_whats_new/3d_plot_aspects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Users can set the aspect ratio for the X, Y, Z axes of a 3D plot to be 'equal',
for i, ax in enumerate(axs):
ax.set_box_aspect((3, 4, 5))
ax.set_aspect(aspects[i])
ax.set_title("set_aspect('{aspects[i]}')")
ax.set_title(f"set_aspect('{aspects[i]}')")

fig.set_size_inches(13, 3)
plt.show()
8 changes: 4 additions & 4 deletions doc/users/next_whats_new/3d_plot_focal_length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ The focal length can be calculated from a desired FOV via the equation:

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig, axs = plt.subplots(1, 3, subplot_kw={'projection': '3d'},
constrained_layout=True)
from numpy import inf
fig, axs = plt.subplots(1, 3, subplot_kw={'projection': '3d'})
X, Y, Z = axes3d.get_test_data(0.05)
focal_lengths = [0.25, 1, 4]
focal_lengths = [0.2, 1, inf]
for ax, fl in zip(axs, focal_lengths):
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
ax.set_proj_type('persp', focal_length=fl)
ax.set_title(f"focal_length = {fl}")
plt.tight_layout()
fig.set_size_inches(10, 4)
plt.show()
1 change: 1 addition & 0 deletions doc/users/next_whats_new/3d_plot_roll_angle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ existing 3D plots.
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
ax.view_init(elev=0, azim=0, roll=30)
ax.set_title('elev=0, azim=0, roll=30')
plt.show()