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.SubplotSpec.html
Version 2.2.0
matplotlib
Fork me on GitHub

This Page

matplotlib.gridspec.SubplotSpec

class matplotlib.gridspec.SubplotSpec(gridspec, num1, num2=None)

Specifies the location of the subplot in the given GridSpec.

The subplot will occupy the num1-th cell of the given gridspec. If num2 is provided, the subplot will span between num1-th cell and num2-th cell.

The index starts from 0.

get_geometry()

Get the subplot geometry (n_rows, n_cols, start, stop).

start and stop are the index of the start and stop of the subplot.

get_gridspec()
get_position(figure, return_all=False)

Update the subplot position from figure.subplotpars.

get_rows_columns()

Get the subplot row and column numbers: (n_rows, n_cols, row_start, row_stop, col_start, col_stop)

get_topmost_subplotspec()

get the topmost SubplotSpec instance associated with the subplot