matplotlib

Travis-CI:

This Page

mpl_toolkits.axes_grid1.axes_grid

class mpl_toolkits.axes_grid1.axes_grid.Grid(fig, rect, nrows_ncols, ngrids=None, direction='row', axes_pad=0.02, add_all=True, share_all=False, share_x=True, share_y=True, label_mode='L', axes_class=None)

A class that creates a grid of Axes. In matplotlib, the axes location (and size) is specified in the normalized figure coordinates. This may not be ideal for images that needs to be displayed with a given aspect ratio. For example, displaying images of a same size with some fixed padding between them cannot be easily done in matplotlib. AxesGrid is used in such case.

Build an Grid instance with a grid nrows*ncols Axes in Figure fig with rect=[left, bottom, width, height] (in Figure coordinates) or the subplot position code (e.g., “121”).

Optional keyword arguments:

Keyword Default Description
direction “row” [ “row” | “column” ]
axes_pad 0.02 float| pad between axes given in inches or tuple-like of floats, (horizontal padding, vertical padding)
add_all True [ True | False ]
share_all False [ True | False ]
share_x True [ True | False ]
share_y True [ True | False ]
label_mode “L” [ “L” | “1” | “all” ]
axes_class None a type object which must be a subclass of Axes
get_aspect()

get aspect

get_axes_locator()
get_axes_pad()

get axes_pad

Returns:

tuple

Padding in inches, (horizontal pad, vertical pad)

get_divider()
get_geometry()

get geometry of the grid. Returns a tuple of two integer, representing number of rows and number of columns.

get_vsize_hsize()
set_aspect(aspect)

set aspect

set_axes_locator(locator)
set_axes_pad(axes_pad)

set axes_pad

set_label_mode(mode)

set label_mode

class mpl_toolkits.axes_grid1.axes_grid.ImageGrid(fig, rect, nrows_ncols, ngrids=None, direction='row', axes_pad=0.02, add_all=True, share_all=False, aspect=True, label_mode='L', cbar_mode=None, cbar_location='right', cbar_pad=None, cbar_size='5%', cbar_set_cax=True, axes_class=None)

A class that creates a grid of Axes. In matplotlib, the axes location (and size) is specified in the normalized figure coordinates. This may not be ideal for images that needs to be displayed with a given aspect ratio. For example, displaying images of a same size with some fixed padding between them cannot be easily done in matplotlib. ImageGrid is used in such case.

Build an ImageGrid instance with a grid nrows*ncols Axes in Figure fig with rect=[left, bottom, width, height] (in Figure coordinates) or the subplot position code (e.g., “121”).

Optional keyword arguments:

Keyword Default Description
direction “row” [ “row” | “column” ]
axes_pad 0.02 float| pad between axes given in inches or tuple-like of floats, (horizontal padding, vertical padding)
add_all True [ True | False ]
share_all False [ True | False ]
aspect True [ True | False ]
label_mode “L” [ “L” | “1” | “all” ]
cbar_mode None [ “each” | “single” | “edge” ]
cbar_location “right” [ “left” | “right” | “bottom” | “top” ]
cbar_pad None  
cbar_size “5%”  
cbar_set_cax True [ True | False ]
axes_class None a type object which must be a subclass of axes_grid’s subclass of Axes
cbar_set_cax
: if True, each axes in the grid has a cax
attribute that is bind to associated cbar_axes.