SubplotGrid.__getitem__¶
- SubplotGrid.__getitem__(key)[source]¶
Get an axes.
- Parameters
key (
int
,slice
, or2-tuple thereof
) – The index. If 1d then the axes in the corresponding sublist are returned. If 2d then the axes that intersect the correspondinggridspec
slots are returned.- Returns
axs (
Axes
orSubplotGrid
) – The axes. If the index included slices then anotherSubplotGrid
is returned.
Example
>>> import proplot as pplt >>> fig, axs = pplt.subplots(nrows=3, ncols=3) >>> axs[3] # the subplots in the second row, first column >>> axs[1, 2] # the subplots in the second row, third column >>> axs[:, 0] # a grid of subplots in the first column