Skip to content

Commit 220ca31

Browse files
authored
Merge pull request matplotlib#20398 from timhoffm/doc-get_aspect
Document Axes.get_aspect()
2 parents 91016d8 + 9382c26 commit 220ca31

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,11 +1566,16 @@ def set_prop_cycle(self, *args, **kwargs):
15661566
self._get_patches_for_fill.set_prop_cycle(prop_cycle)
15671567

15681568
def get_aspect(self):
1569+
"""
1570+
Return the aspect ratio of the axes scaling.
1571+
1572+
This is either "auto" or a float giving the ratio of y/x-scale.
1573+
"""
15691574
return self._aspect
15701575

15711576
def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
15721577
"""
1573-
Set the aspect of the axis scaling, i.e. the ratio of y-unit to x-unit.
1578+
Set the aspect ratio of the axes scaling, i.e. y/x-scale.
15741579
15751580
Parameters
15761581
----------
@@ -1579,8 +1584,10 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
15791584
15801585
- 'auto': fill the position rectangle with data.
15811586
- 'equal': same as ``aspect=1``, i.e. same scaling for x and y.
1582-
- *float*: A circle will be stretched such that the height
1583-
is *float* times the width.
1587+
- *float*: The displayed size of 1 unit in y-data coordinates will
1588+
be *aspect* times the displayed size of 1 unit in x-data
1589+
coordinates; e.g. for ``aspect=2`` a square in data coordinates
1590+
will be rendered with a height of twice its width.
15841591
15851592
adjustable : None or {'box', 'datalim'}, optional
15861593
If not ``None``, this defines which parameter will be adjusted to

0 commit comments

Comments
 (0)