subplots#

named_arrays.plt.subplots(axis_rows='subplots_row', axis_cols='subplots_col', ncols=1, nrows=1, *, sharex=False, sharey=False, squeeze=True, origin='lower', **kwargs)#

A thin wrapper around matplotlib.pyplot.subplots() which allows for providing axis names to the rows and columns.

Unlike matplotlib.pyplot.subplots(), this function arranges the subplot grid with the origin in the lower-left corner as opposed to the upper-left corner.

Parameters:
  • axis_rows (str) – Name of the axis representing the rows in the subplot grid. If None, the squeeze argument must be True.

  • nrows (int) – Number of rows in the subplot grid

  • axis_cols (str) – Name of the axis representing the columns in the subplot grid If None, the squeeze argument must be True.

  • ncols (int) – Number of columns in the subplot grid

  • sharex (bool | Literal['none', 'all', 'row', 'col']) – Controls whether all the matplotlib.axes.Axes instances share the same horizontal axis properties. See the documentation of matplotlib.pyplot.subplots() for more information.

  • sharey (bool | Literal['none', 'all', 'row', 'col']) – Controls whether all the matplotlib.axes.Axes instances share the same vertical axis properties. See the documentation of matplotlib.pyplot.subplots() for more information.

  • squeeze (bool) – If True, numpy.squeeze() is called on the result, which removes singleton dimensions from the array. See the documentation of matplotlib.pyplot.subplots() for more information.

  • origin (Literal['lower', 'upper']) – Place the (0, 0) axis in the upper-left or lower-left corner. Defaults to lower-left since this mirrors the mathematical convention, but this is the opposite convention adopted by matplotlib.pyplot.subplots().

  • kwargs – Additional keyword arguments passed to matplotlib.pyplot.subplots()

Return type:

tuple[Figure, Axes | ScalarArray[ndarray[tuple[Any, …], dtype[_ScalarT]]]]