mpl_toolkits.axes_grid1.inset_locator.InsetPosition

class mpl_toolkits.axes_grid1.inset_locator.InsetPosition(parent, lbwh)[source]

Bases: object

An object for positioning an inset axes.

This is created by specifying the normalized coordinates in the axes, instead of the figure.

Parameters:
parentmatplotlib.axes.Axes

Axes to use for normalizing coordinates.

lbwhiterable of four floats

The left edge, bottom edge, width, and height of the inset axes, in units of the normalized coordinate of the parent axes.

Examples

The following bounds the inset axes to a box with 20% of the parent axes's height and 40% of the width. The size of the axes specified ([0, 0, 1, 1]) ensures that the axes completely fills the bounding box:

>>> parent_axes = plt.gca()
>>> ax_ins = plt.axes([0, 0, 1, 1])
>>> ip = InsetPosition(ax, [0.5, 0.1, 0.4, 0.2])
>>> ax_ins.set_axes_locator(ip)
__call__(self, ax, renderer)[source]

Call self as a function.

__dict__ = mappingproxy({'__module__': 'mpl_toolkits.axes_grid1.inset_locator', '__init__': <function InsetPosition.__init__>, '__call__': <function InsetPosition.__call__>, '__dict__': <attribute '__dict__' of 'InsetPosition' objects>, '__weakref__': <attribute '__weakref__' of 'InsetPosition' objects>, '__doc__': None})
__init__(self, parent, lbwh)[source]

An object for positioning an inset axes.

This is created by specifying the normalized coordinates in the axes, instead of the figure.

Parameters:
parentmatplotlib.axes.Axes

Axes to use for normalizing coordinates.

lbwhiterable of four floats

The left edge, bottom edge, width, and height of the inset axes, in units of the normalized coordinate of the parent axes.

Examples

The following bounds the inset axes to a box with 20% of the parent axes's height and 40% of the width. The size of the axes specified ([0, 0, 1, 1]) ensures that the axes completely fills the bounding box:

>>> parent_axes = plt.gca()
>>> ax_ins = plt.axes([0, 0, 1, 1])
>>> ip = InsetPosition(ax, [0.5, 0.1, 0.4, 0.2])
>>> ax_ins.set_axes_locator(ip)
__module__ = 'mpl_toolkits.axes_grid1.inset_locator'
__weakref__

list of weak references to the object (if defined)

Examples using mpl_toolkits.axes_grid1.inset_locator.InsetPosition