mpl_toolkits.axes_grid1.axes_divider.AxesDivider#

classmpl_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 interpretedasaxes_size.from_any(size,AxesX(<main_axes>)) for left orright axes, and likewise withAxesY for bottom or top axes.

padaxes_size or float or str

Padding between the axes. float or str arguments are interpretedas forsize. Defaults torcParams["figure.subplot.wspace"] (default:0.2) times themain Axes width (left or right axes) orrcParams["figure.subplot.hspace"] (default:0.2)times the main Axes height (bottom or top axes).

axes_classsubclass type ofAxes, 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 usingmpl_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