matplotlib.axes.SubplotBase#

class matplotlib.axes.SubplotBase(fig, *args, **kwargs)[source]#

Bases: object

Base class for subplots, which are Axes instances with additional methods to facilitate generating and manipulating a set of Axes within a figure.

Parameters
figmatplotlib.figure.Figure
*argstuple (nrows, ncols, index) or int

The array of subplots in the figure has dimensions (nrows, ncols), and index is the index of the subplot being created. index starts at 1 in the upper left corner and increases to the right.

If nrows, ncols, and index are all single digit numbers, then args can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).

**kwargs

Keyword arguments are passed to the Axes (sub)class constructor.

change_geometry(numrows, numcols, num)[source]#

[Deprecated] Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3).

Notes

Deprecated since version 3.4: Use set_subplotspec instead.

property figbox[source]#
get_geometry()[source]#

[Deprecated] Get the subplot geometry, e.g., (2, 2, 3).

Notes

Deprecated since version 3.4: Use get_subplotspec instead. (get_subplotspec returns a SubplotSpec instance.)

get_gridspec()[source]#

Return the GridSpec instance associated with the subplot.

get_subplotspec()[source]#

Return the SubplotSpec instance associated with the subplot.

is_first_col()[source]#

[Deprecated]

Notes

Deprecated since version 3.4: Use ax.get_subplotspec().is_first_col() instead.

is_first_row()[source]#

[Deprecated]

Notes

Deprecated since version 3.4: Use ax.get_subplotspec().is_first_row() instead.

is_last_col()[source]#

[Deprecated]

Notes

Deprecated since version 3.4: Use ax.get_subplotspec().is_last_col() instead.

is_last_row()[source]#

[Deprecated]

Notes

Deprecated since version 3.4: Use ax.get_subplotspec().is_last_row() instead.

label_outer()[source]#

Only show "outer" labels and tick labels.

x-labels are only kept for subplots on the last row (or first row, if labels are on the top side); y-labels only for subplots on the first column (or last column, if labels are on the right side).

property numCols[source]#
property numRows[source]#
set_subplotspec(subplotspec)[source]#

Set the SubplotSpec. instance associated with the subplot.

update_params()[source]#

[Deprecated] Update the subplot position from self.figure.subplotpars.

Notes

Deprecated since version 3.4.