mpl_toolkits.axes_grid1.axes_divider.AxesDivider#

class mpl_toolkits.axes_grid1.axes_divider.AxesDivider(axes, xref=None, yref=None)[source]#

Bases: Divider

Divider based on the preexisting axes.

Parameters:
axesAxes
xref
yref
append_axes(position, size, pad=None, *, axes_class=None, **kwargs)[source]#

Add a new axes on a given side of the main axes.

Parameters:
position{"left", "right", "bottom", "top"}

Where the new axes is positioned relative to the main axes.

sizeaxes_size or float or str

The axes width or height. float or str arguments are interpreted as axes_size.from_any(size, AxesX(<main_axes>)) for left or right axes, and likewise with AxesY for bottom or top axes.

padaxes_size or float or str

Padding between the axes. float or str arguments are interpreted as for size. Defaults to rcParams["figure.subplot.wspace"] (default: 0.2) times the main Axes width (left or right axes) or rcParams["figure.subplot.hspace"] (default: 0.2) times the main Axes height (bottom or top axes).

axes_classsubclass type of Axes, optional

The type of the new axes. Defaults to the type of the main axes.

**kwargs

All extra keywords arguments are passed to the created axes.

get_anchor()[source]#

Return the anchor.

get_aspect()[source]#

Return aspect.

get_position()[source]#

Return the position of the rectangle.

get_subplotspec()[source]#

Examples using mpl_toolkits.axes_grid1.axes_divider.AxesDivider#

Colorbar with AxesDivider

Colorbar with AxesDivider

Make room for ylabel using axes_grid

Make room for ylabel using axes_grid

Align histogram to scatter plot using locatable Axes

Align histogram to scatter plot using locatable Axes

Tight layout guide

Tight layout guide