### Navigation

- index
- modules |
- next |
- previous |
- home|
- examples|
- tutorials|
- pyplot|
- docs »
- The Matplotlib API »

# gridspec

## `matplotlib.gridspec`

`gridspec` is a module which specifies the location of the subplot in the figure.

> `GridSpec`
>   specifies the geometry of the grid that a subplot will be placed. The number of rows and number of columns of the grid need to be set. Optionally, the subplot layout parameters (e.g., left, right, etc.) can be tuned.
> `SubplotSpec`
>   specifies the location of the subplot in the given GridSpec.

### Classes

`GridSpec`(nrows, ncols[, left, bottom, …]) | A class that specifies the geometry of the grid that a subplot will be placed.
`SubplotSpec`(gridspec, num1[, num2]) | specifies the location of the subplot in the given 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.