Figure.subplot¶
- Figure.subplot(*args, **kwargs)[source]¶
Add a subplot axes to the figure.
- Parameters
*args (
int
,tuple
, orSubplotSpec
, optional) – The subplot location specifier. Your options are:A single 3-digit integer argument specifying the number of rows, number of columns, and gridspec number (using row-major indexing).
Three positional arguments specifying the number of rows, number of columns, and gridspec number (int) or number range (2-tuple of int).
A
SubplotSpec
instance generated by indexing a proplotGridSpec
.
For integer input, the implied geometry must be compatible with the implied geometry from previous calls – for example,
fig.add_subplot(331)
followed byfig.add_subplot(132)
is valid because the 1 row of the second input can be tiled into the 3 rows of the the first input, butfig.add_subplot(232)
will raise an error because 2 rows cannot be tiled into 3 rows. ForSubplotSpec
input, theSubplotSpec
must be derived from theGridSpec
used in previous calls.These restrictions arise because we allocate a single, unique
gridspec
for each figure.number (
int
, optional) – The axes number used for a-b-c labeling. Seeformat
for details. By default this is incremented automatically based on the other subplots in the figure. Use e.g.number=None
ornumber=False
to ensure the subplot has no a-b-c label. Note the number corresponding toa
is1
, not0
.autoshare (
bool
, default:True
) – Whether to automatically share the x and y axes with subplots spanning the same rows and columns based on the figure-widesharex
andsharey
settings. This has no effect ifrc['subplots.share']
isFalse
or ifsharex=False
orsharey=False
were passed to the figure.proj, projection (
str
,cartopy.crs.Projection
, orBasemap
, optional) – The map projection specification(s). If'cart'
or'cartesian'
(the default), aCartesianAxes
is created. If'polar'
, aPolarAxes
is created. Otherwise, the argument is interpreted byProj
, and the result is used to make aGeoAxes
(in this case the argument can be acartopy.crs.Projection
instance, aBasemap
instance, or a projection name listed in this table).proj_kw, projection_kw (dict-like, optional) – Keyword arguments passed to
Basemap
or cartopyProjection
classes on instantiation.backend (
{'cartopy', 'basemap'}
, default:rc['geo.backend']
='cartopy'
) – Whether to useBasemap
orProjection
for map projections.
- Other Parameters
**kwargs – Passed to the proplot class
proplot.axes.CartesianAxes
,proplot.axes.PolarAxes
,proplot.axes.GeoAxes
, orproplot.axes.ThreeAxes
. This can include keyword arguments for projection-specificformat
commands.