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

Skip to content

Commit f8c35e0

Browse files
committed
DOC: Document that set_aspect applies the aspect lazily
Makes the effect in #31232 easier to understand. Helps a bit clarifying the original vs. active position concept #31254.
1 parent 0aa0739 commit f8c35e0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/matplotlib/axes/_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,12 +1700,21 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
17001700
share : bool, default: False
17011701
If ``True``, apply the settings to all shared Axes.
17021702
1703+
Notes
1704+
-----
1705+
The aspect will require an update of the Axes position or limits (which
1706+
one depends on *adjustable*). This update is applied lazily, the latest
1707+
when the figure is drawn. Use `.apply_aspect` to force an update.
1708+
17031709
See Also
17041710
--------
17051711
matplotlib.axes.Axes.set_adjustable
17061712
Set how the Axes adjusts to achieve the required aspect ratio.
17071713
matplotlib.axes.Axes.set_anchor
17081714
Set the position in case of extra space.
1715+
matplotlib.axes.Axes.apply_aspect
1716+
Force the update required to meet the aspect ratio to happen
1717+
immediately.
17091718
"""
17101719
if cbook._str_equal(aspect, 'equal'):
17111720
aspect = 1

0 commit comments

Comments
 (0)