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 be confused with the data aspect (see set_aspect).

aspectfloat or None

Changes the physical dimensions of the Axes, such that the ratio of the axes height to the axes width in physical units is equal to aspect. Defining a box aspect will change the adjustable property to 'datalim' (see set_adjustable).

None will disable a fixed box aspect so that height and width of the axes are chosen independently.

See also

for a description of aspect handling.

Examples using matplotlib.axes.Axes.set_box_aspect