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 9382c26

Browse filesBrowse files
committed
Document Axes.get_aspect()
1 parent 63261cc commit 9382c26
Copy full SHA for 9382c26

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+10
-3
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+10-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.