You are reading an old version of the documentation (v2.2.0). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.gridspec.GridSpecBase.html
Version 2.2.0
matplotlib
Fork me on GitHub

This Page

matplotlib.gridspec.GridSpecBase

class matplotlib.gridspec.GridSpecBase(nrows, ncols, height_ratios=None, width_ratios=None)

A base class of GridSpec that 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 ratio of heights and widths of rows and columns can be specified.

get_geometry()

get the geometry of the grid, e.g., 2,3

get_grid_positions(fig, raw=False)

return lists of bottom and top position of rows, left and right positions of columns.

If raw=True, then these are all in units relative to the container with no margins. (used for constrained_layout).

get_height_ratios()
get_subplot_params(figure=None, fig=None)
get_width_ratios()
new_subplotspec(loc, rowspan=1, colspan=1)

create and return a SuplotSpec instance.

set_height_ratios(height_ratios)
set_width_ratios(width_ratios)