Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4ea381

Browse filesBrowse files
committed
Updated "What's New" entry.
1 parent 703ddc5 commit a4ea381
Copy full SHA for a4ea381

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed

‎doc/users/next_whats_new/3d_plot_aspects.rst

Copy file name to clipboardExpand all lines: doc/users/next_whats_new/3d_plot_aspects.rst
+7-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.