Figure.subplot(*args, **kwargs)[source]

Add a subplot axes to the figure.

  • *args (int, tuple, or SubplotSpec, 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 proplot GridSpec.

    For integer input, the implied geometry must be compatible with the implied geometry from previous calls – for example, fig.add_subplot(331) followed by fig.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, but fig.add_subplot(232) will raise an error because 2 rows cannot be tiled into 3 rows. For SubplotSpec input, the SubplotSpec must be derived from the GridSpec 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. See format for details. By default this is incremented automatically based on the other subplots in the figure. Use 0 or False to ensure the subplot has no a-b-c label. Note the number corresponding to a is 1, not 0.

  • autoshare (bool, optional) – Whether to automatically share the x and y axes with subplots spanning the same rows and columns based on the figure-wide sharex and sharey settings. Default is True. This has no effect if rc['subplots.share'] is False or if sharex=False or sharey=False were passed to the figure.

  • proj, projection (str,, or Basemap, optional) – The map projection specification(s). If 'cart' or 'cartesian' (the default), a CartesianAxes is created. If 'polar', a PolarAxes is created. Otherwise, the argument is interpreted by Proj, and the result is used to make a GeoAxes (in this case the argument can be a instance, a Basemap instance, or a projection name listed in this table).

  • proj_kw, projection_kw (dict-like, optional) – Keyword arguments passed to Basemap or cartopy Projection classes on instantiation.

  • basemap (bool or dict-like, optional) – Whether to use Basemap or Projection for map projections. Default is rc.basemap = False.

Other Parameters

**kwargs – Passed to matplotlib.axes.Axes.