matplotlib.axes.Axes.set_aspect — Matplotlib 3.10.1 documentation (original) (raw)

Axes.set_aspect(aspect, adjustable=None, anchor=None, share=False)[source]#

Set the aspect ratio of the Axes scaling, i.e. y/x-scale.

Parameters:

aspect{'auto', 'equal'} or float

Possible values:

adjustableNone or {'box', 'datalim'}, optional

If not None, this defines which parameter will be adjusted to meet the required aspect. See set_adjustable for further details.

anchorNone or str or (float, float), optional

If not None, this defines where the Axes will be drawn if there is extra space due to aspect constraints. The most common way to specify the anchor are abbreviations of cardinal directions:

See set_anchor for further details.

sharebool, default: False

If True, apply the settings to all shared Axes.

Examples using matplotlib.axes.Axes.set_aspect#