mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase

class mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase(bbox_to_anchor, offsetbox, loc, borderpad=0.5, bbox_transform=None)[source]

Bases: matplotlib.offsetbox.AnchoredOffsetbox

Parameters:
locstr

The box location. Supported values:

  • 'upper right'
  • 'upper left'
  • 'lower left'
  • 'lower right'
  • 'center left'
  • 'center right'
  • 'lower center'
  • 'upper center'
  • 'center'

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.

childOffsetBox

The box that will be anchored.

propFontProperties

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

frameonbool

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).

**kwargs

All other parameters are passed on to OffsetBox.

Notes

See Legend for a detailed description of the anchoring mechanism.

__call__(ax, renderer)[source]

Call self as a function.

__init__(bbox_to_anchor, offsetbox, loc, borderpad=0.5, bbox_transform=None)[source]
Parameters:
locstr

The box location. Supported values:

  • 'upper right'
  • 'upper left'
  • 'lower left'
  • 'lower right'
  • 'center left'
  • 'center right'
  • 'lower center'
  • 'upper center'
  • 'center'

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.

childOffsetBox

The box that will be anchored.

propFontProperties

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

frameonbool

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).

**kwargs

All other parameters are passed on to OffsetBox.

Notes

See Legend for a detailed description of the anchoring mechanism.

__module__ = 'mpl_toolkits.axes_grid1.inset_locator'
draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.