matplotlib.axes.Axes.set_box_aspect#

Axes.set_box_aspect(aspect=None)[source]#

Set the Axes box aspect, i.e. the ratio of height to width.

This defines the aspect of the Axes in figure space and is not to beconfused with the data aspect (seeset_aspect).

Parameters:
aspectfloat or None

Changes the physical dimensions of the Axes, such that the ratioof the Axes height to the Axes width in physical units is equal toaspect. Defining a box aspect will change theadjustableproperty to 'datalim' (seeset_adjustable).

None will disable a fixed box aspect so that height and widthof the Axes are chosen independently.

See also

matplotlib.axes.Axes.set_aspect

for a description of aspect handling.

Examples usingmatplotlib.axes.Axes.set_box_aspect#

Multiple Axes animation

Multiple Axes animation

3D box surface plot

3D box surface plot

Axes box aspect

Axes box aspect