matplotlib.gridspec#

gridspec contains classes that help to layout multipleAxes in a grid-like pattern within a figure.

TheGridSpec specifies the overall grid structure. Individual cells withinthe grid are referenced bySubplotSpecs.

Often, users need not access this module directly, and can use higher-levelmethods likesubplots,subplot_mosaic andsubfigures. See the tutorialArranging multiple Axes in a Figure for a guide.

Classes#

GridSpec(nrows, ncols[, figure, left, ...])

A grid layout to place subplots within a figure.

SubplotSpec(gridspec, num1[, num2])

The location of a subplot in aGridSpec.

GridSpecBase(nrows, ncols[, height_ratios, ...])

A base class of GridSpec that specifies the geometry of the grid that a subplot will be placed.

GridSpecFromSubplotSpec(nrows, ncols, ...[, ...])

GridSpec whose subplot layout parameters are inherited from the location specified by a given SubplotSpec.

SubplotParams([left, bottom, right, top, ...])

Parameters defining the positioning of a subplots grid in a figure.

On this page