class mpl_toolkits.axes_grid1.inset_locator.AnchoredSizeLocator(bbox_to_anchor, x_size, y_size, loc, borderpad=0.5, bbox_transform=None)[source]

Bases: mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase


The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.

padfloat, default: 0.4

Padding around the child as fraction of the fontsize.

borderpadfloat, default: 0.5

Padding between the offsetbox frame and the bbox_to_anchor.


The box that will be anchored.


This is only used as a reference for paddings. If not given, rcParams["legend.fontsize"] (default: 'medium') is used.


Whether to draw a frame around the box.

bbox_to_anchorBboxBase, 2-tuple, or 4-tuple of floats

Box that is used to position the legend in conjunction with loc.

bbox_transformNone or matplotlib.transforms.Transform

The transform for the bounding box (bbox_to_anchor).


All other parameters are passed on to OffsetBox.


See Legend for a detailed description of the anchoring mechanism.


Return the extent of the box as (width, height, x, y).

This is the extent of the child plus the padding.