You are reading an old version of the documentation (v3.1.1). For the latest version see
Version 3.1.2
Fork me on GitHub

Table of Contents


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

The GridSpec specifies the overall grid structure. Individual cells within the grid are referenced by SubplotSpecs.

See the tutorial Customizing Figure Layouts Using GridSpec and Other Functions for a comprehensive usage guide.


GridSpec(nrows, ncols[, figure, left, ...]) Specifies the geometry of the grid that a subplot can be placed in.
SubplotSpec(gridspec, num1[, num2]) Specifies the location of a subplot in a GridSpec.
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.