pygmt.subplots

pygmt.subplots(nrows=1, ncols=1, figsize=(6.4, 4.8), autolabel=None, margins=None, title=None, **kwargs)[source]

Create a figure with a set of subplots.

Full option list at https://docs.generic-mapping-tools.org/latest/subplot.html#synopsis-begin-mode

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

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

  • figsize (tuple) – Overall figure dimensions as (width, height). Default is (6.4, 4.8)

  • autolabel (bool or str) – [autolabel][+cdx[/dy]][+gfill][+j|Jrefpoint][+odx[/dy]][+ppen][+r|R] [+v]. Specify automatic tagging of each subplot. Append either a number or letter [a]. This sets the tag of the first, top-left subplot and others follow sequentially. Surround the number or letter by parentheses on any side if these should be typeset as part of the tag. Use +j|Jrefpoint to specify where the tag should be placed in the subplot [TL]. Note: +j sets the justification of the tag to refpoint (suitable for interior tags) while +J instead selects the mirror opposite (suitable for exterior tags). Append +cdx*[/*dy] to set the clearance between the tag and a surrounding text box requested via +g or +p [3p/3p, i.e., 15% of the FONT_TAG size dimension]. Append +gfill to paint the tag’s text box with fill [no painting]. Append +odx[/dy] to offset the tag’s reference point in the direction implied by the justification [4p/4p, i.e., 20% of the FONT_TAG size]. Append +ppen to draw the outline of the tag’s text box using selected pen [no outline]. Append +r to typeset your tag numbers using lowercase Roman numerals; use +R for uppercase Roman numerals [Arabic numerals]. Append +v to increase tag numbers vertically down columns [horizontally across rows].

  • margins (tuple) –

    This is margin space that is added between neighboring subplots (i.e., the interior margins) in addition to the automatic space added for tick marks, annotations, and labels. The margins can be specified as either:

    • a single value (for same margin on all sides). E.g. ‘5c’.

    • a pair of values (for setting separate horizontal and vertical margins). E.g. [‘5c’, ‘3c’].

    • a set of four values (for setting separate left, right, bottom, and top margins). E.g. [‘1c’, ‘2c’, ‘3c’, ‘4c’].

    The actual gap created is always a sum of the margins for the two opposing sides (e.g., east plus west or south plus north margins) [Default is half the primary annotation font size, giving the full annotation font size as the default gap].

  • title (str) – Overarching heading for the entire figure. Font is determined by setting FONT_HEADING.

Returns

  • fig (pygmt.Figure) – A PyGMT Figure instance.

  • axs (numpy.ndarray) – Array of Axes objects.

Examples using pygmt.subplots