Version 3.0.3
matplotlib
Fork me on GitHub

mpl_toolkits.axes_grid1.axes_divider.Divider

class mpl_toolkits.axes_grid1.axes_divider.Divider(fig, pos, horizontal, vertical, aspect=None, anchor='C')[source]

Bases: object

This class calculates the axes position. It divides the given rectangular area into several sub-rectangles. You initialize the divider by setting the horizontal and vertical lists of sizes (mpl_toolkits.axes_grid.axes_size) that the division will be based on. You then use the new_locator method to create a callable object that can be used as the axes_locator of the axes.

Parameters:
fig : Figure
pos : tuple of 4 floats

position of the rectangle that will be divided

horizontal : list of axes_size

sizes for horizontal division

vertical : list of axes_size

sizes for vertical division

aspect : bool

if True, the overall rectangular area is reduced so that the relative part of the horizontal and vertical scales have the same scale.

anchor : {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}

placement of the reduced rectangle when aspect is True

add_auto_adjustable_area(use_axes, pad=0.1, adjust_dirs=None)[source]
append_size(position, size)[source]
get_anchor()[source]

return the anchor

get_aspect()[source]

return aspect

get_horizontal()[source]

return horizontal sizes

get_horizontal_sizes(renderer)[source]
get_locator()[source]
get_position()[source]

return the position of the rectangle.

get_position_runtime(ax, renderer)[source]
get_vertical()[source]

return vertical sizes

get_vertical_sizes(renderer)[source]
get_vsize_hsize()[source]
locate(nx, ny, nx1=None, ny1=None, axes=None, renderer=None)[source]
Parameters:
nx, nx1 : int

Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.

ny, ny1 : int

Same as nx and nx1, but for row positions.

axes
renderer
new_locator(nx, ny, nx1=None, ny1=None)[source]

Returns a new locator (mpl_toolkits.axes_grid.axes_divider.AxesLocator) for specified cell.

Parameters:
nx, nx1 : int

Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.

ny, ny1 : int

Same as nx and nx1, but for row positions.

set_anchor(anchor)[source]
Parameters:
anchor : {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}

anchor position

value description
'C' Center
'SW' bottom left
'S' bottom
'SE' bottom right
'E' right
'NE' top right
'N' top
'NW' top left
'W' left
set_aspect(aspect=False)[source]
Parameters:
aspect : bool
set_horizontal(h)[source]
Parameters:
h : list of axes_size

sizes for horizontal division

set_locator(_locator)[source]
set_position(pos)[source]

set the position of the rectangle.

Parameters:
pos : tuple of 4 floats

position of the rectangle that will be divided

set_vertical(v)[source]
Parameters:
v : list of axes_size

sizes for vertical division