matplotlib.axes.Axes.inset_axes
- Axes.inset_axes(bounds, *, transform=None, zorder=5, **kwargs)
Add a child inset Axes to this existing Axes.
- Parameters:
- bounds : [x0, y0, width, height]
Add a child inset Axes to this existing Axes.
Lower-left corner of inset Axes, and its width and height.
TransformDefaults to ax.transAxes, i.e. the units of rect are in
Axes-relative coordinates.
The projection type of the inset Axes. str is the name
of a custom projection, see projections. The default
None results in a 'rectilinear' projection.
If True, equivalent to projection='polar'.
Axes, optionalThe axes.Axes subclass that is instantiated. This parameter
is incompatible with projection and polar. See
axisartist for examples.
Defaults to 5 (same as Axes.legend). Adjust higher or lower
to change whether it is above or below data plotted on the
parent Axes.
Other keyword arguments are passed on to the inset Axes class.
The created Axes instance.
This example makes two inset Axes, the first is in Axes-relative coordinates, and the second in data-coordinates:
fig, ax = plt.subplots()
ax.plot(range(10))
axin1 = ax.inset_axes([0.8, 0.1, 0.15, 0.15])
axin2 = ax.inset_axes(
[5, 7, 2.3, 2.3], transform=ax.transData)
matplotlib.axes.Axes.inset_axes