Matplotlib.axes.Axes.set_aspect() Syntax
Syntax : matplotlib.axes.Axes.set_aspect(aspect, adjustable=None, anchor=None, share=False, **kwargs)
Parameter :
- aspect : This parameter accepts the following value {‘auto’, ‘equal’} or num.
- adjustable : This defines which parameter will be adjusted to meet the required aspect.
- anchor : This parameter is used to define where the Axes will be drawn if there is extra space due to aspect constraints.
- share: This parameter is used to apply the settings to all shared Axes.
Return type: This method does not return anything (
None
).
Matplotlib.axes.Axes.set_aspect() in Python
The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. The instances of Axes support callbacks through a callbacks attribute. Matplotlib.axes.Axes.set_aspect()` in Python is a method used to set the aspect ratio of the axes in a Matplotlib plot.