Bases: object
A base class of GridSpec that specifies the geometry of the grid that a subplot will be placed.
The number of rows and columns of the grid.
Defines the relative widths of the columns. Each column gets a relative width of width_ratios[i] / sum(width_ratios)
. If not given, all columns will have the same width.
Defines the relative heights of the rows. Each row gets a relative height of height_ratios[i] / sum(height_ratios)
. If not given, all rows will have the same height.
Return a tuple containing the number of rows and columns in the grid.
Return the positions of the grid cells in figure coordinates.
Figure
The figure the grid should be applied to. The subplot parameters (margins and spacing between subplots) are taken from fig.
If True, the subplot parameters of the figure are not taken into account. The grid spans the range [0, 1] in both directions without margins and there is no space between grid cells. This is used for constrained_layout.
The bottom, top, left, right positions of the grid cells in figure coordinates.
Return the height ratios.
This is None if no height ratios have been set explicitly.
Return the width ratios.
This is None if no width ratios have been set explicitly.
The number of columns in the grid.
Create and return a SubplotSpec
instance.
The position of the subplot in the grid as (row_index, column_index)
.
The number of rows and columns the subplot should span in the grid.
The number of rows in the grid.
Set the relative heights of the rows.
height_ratios must be of length nrows. Each row gets a relative height of height_ratios[i] / sum(height_ratios)
.
Set the relative widths of the columns.
width_ratios must be of length ncols. Each column gets a relative width of width_ratios[i] / sum(width_ratios)
.
Add all subplots specified by this GridSpec
to its parent figure.
See Figure.subplots
for detailed documentation.
matplotlib.gridspec.GridSpecBase
© 2012–2021 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.5.1/api/_as_gen/matplotlib.gridspec.GridSpecBase.html