mplutils.set_axes_size#

mplutils.set_axes_size(width, height=None, *, aspect='auto', ax=None, anchor='auto', unit='inch')[source]#

Set physical size of ax.

Parameters:
widthfloat

Desired width of ax in units of unit.

heightfloat, optional

Desired height of ax in units of unit.

If None, determine height according to aspect.

aspect“auto” or float, default “auto”

Control the aspect ratio.

“auto”:

Determine aspect ratio using width and height. If height is None, use an aspect ratio of 1.

float:

Set aspect ratio of ax to height / width.

If height / width != aspect, raises a ValueError.

axmatplotlib.axes.Axes, optional

If None, change last active axes.

anchor(float, float) or {“auto”, “C”, “N”, “NW”, “W”, “SW”, …}, default “auto”

Anchor point of ax.

If “auto”, use matplotlib.axes.Axes.get_anchor().

unit{"mm" , "inch" , "pts"}, default "pts"

Units of width and height.