Skip to content

Commit 21f9d54

Browse files
committed
Updated "What's New" entry.
1 parent 2a702cf commit 21f9d54

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/users/next_whats_new/3d_plot_aspects.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ Set equal aspect ratio for 3D plots
22
-----------------------------------
33

44
Users can set the aspect ratio for the X, Y, Z axes of a 3D plot to be 'equal',
5-
'equalxy', 'equalxz', or 'equalyz' rather than the default of 'auto'.
5+
'equalxy', 'equalxz', or 'equalyz' rather than the default of 'auto'. Just like
6+
in case of 2D plots, either the data limits or the bounding box can be adjusted
7+
to achieve the desired aspect.
68

79
.. plot::
810
:include-source: true
@@ -26,7 +28,9 @@ Users can set the aspect ratio for the X, Y, Z axes of a 3D plot to be 'equal',
2628
# Set the aspect ratios
2729
for i, ax in enumerate(axs):
2830
ax.set_box_aspect((3, 4, 5))
29-
ax.set_aspect(aspects[i])
30-
ax.set_title("set_aspect('{aspects[i]}')")
31+
ax.set_aspect(aspects[i], adjustable='datalim')
32+
# Alternatively: ax.set_aspect(aspects[i], adjustable='box')
33+
# which will modify the box aspect ratio instead of the data limits.
34+
ax.set_title(f"set_aspect('{aspects[i]}')")
3135

3236
plt.show()

0 commit comments

Comments
 (0)