From 032d9931a2e4bdcec1a284b500bd47c53d402699 Mon Sep 17 00:00:00 2001 From: Scott Shambaugh Date: Mon, 29 Aug 2022 22:40:33 -0600 Subject: [PATCH] Whats new plot cleanups --- doc/users/next_whats_new/3d_plot_aspects.rst | 3 ++- doc/users/next_whats_new/3d_plot_focal_length.rst | 8 ++++---- doc/users/next_whats_new/3d_plot_roll_angle.rst | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/users/next_whats_new/3d_plot_aspects.rst b/doc/users/next_whats_new/3d_plot_aspects.rst index ebd7afae92ef..a65160b4face 100644 --- a/doc/users/next_whats_new/3d_plot_aspects.rst +++ b/doc/users/next_whats_new/3d_plot_aspects.rst @@ -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() diff --git a/doc/users/next_whats_new/3d_plot_focal_length.rst b/doc/users/next_whats_new/3d_plot_focal_length.rst index 9422faa71546..41750851dc06 100644 --- a/doc/users/next_whats_new/3d_plot_focal_length.rst +++ b/doc/users/next_whats_new/3d_plot_focal_length.rst @@ -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() diff --git a/doc/users/next_whats_new/3d_plot_roll_angle.rst b/doc/users/next_whats_new/3d_plot_roll_angle.rst index c594c9a5a79d..66674297077b 100644 --- a/doc/users/next_whats_new/3d_plot_roll_angle.rst +++ b/doc/users/next_whats_new/3d_plot_roll_angle.rst @@ -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()