X Tutup
Skip to content

Commit b308fcd

Browse files
authored
Merge pull request #31258 from timhoffm/doc-set_aspect
DOC: Document that set_aspect applies the aspect lazily
2 parents 9d83ca6 + f8c35e0 commit b308fcd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,12 +1716,21 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
17161716
share : bool, default: False
17171717
If ``True``, apply the settings to all shared Axes.
17181718
1719+
Notes
1720+
-----
1721+
The aspect will require an update of the Axes position or limits (which
1722+
one depends on *adjustable*). This update is applied lazily, the latest
1723+
when the figure is drawn. Use `.apply_aspect` to force an update.
1724+
17191725
See Also
17201726
--------
17211727
matplotlib.axes.Axes.set_adjustable
17221728
Set how the Axes adjusts to achieve the required aspect ratio.
17231729
matplotlib.axes.Axes.set_anchor
17241730
Set the position in case of extra space.
1731+
matplotlib.axes.Axes.apply_aspect
1732+
Force the update required to meet the aspect ratio to happen
1733+
immediately.
17251734
"""
17261735
if cbook._str_equal(aspect, 'equal'):
17271736
aspect = 1

0 commit comments

Comments
 (0)
X Tutup