99from pygmt .alias import Alias , AliasSystem
1010from pygmt .clib import Session
1111from pygmt .exceptions import GMTInvalidInput , GMTValueError
12- from pygmt .helpers import (
13- build_arg_list ,
14- fmt_docstring ,
15- kwargs_to_strings ,
16- use_alias ,
17- )
12+ from pygmt .helpers import build_arg_list , fmt_docstring , kwargs_to_strings , use_alias
1813
1914
2015@fmt_docstring
2621 C = "clearance" ,
2722 SC = "sharex" ,
2823 SR = "sharey" ,
29- T = "title" ,
3024)
3125@kwargs_to_strings (Ff = "sequence" , Fs = "sequence" )
3226def subplot (
3327 self ,
34- nrows = 1 ,
35- ncols = 1 ,
28+ nrows : int = 1 ,
29+ ncols : int = 1 ,
3630 margins : float | str | Sequence [float | str ] | None = None ,
31+ title : str | None = None ,
3732 projection : str | None = None ,
3833 frame : str | Sequence [str ] | bool = False ,
3934 region : Sequence [float | str ] | str | None = None ,
@@ -57,13 +52,14 @@ def subplot(
5752 - J = projection
5853 - M = margins
5954 - R = region
55+ - T = title
6056 - V = verbose
6157
6258 Parameters
6359 ----------
64- nrows : int
60+ nrows
6561 Number of vertical rows of the subplot grid.
66- ncols : int
62+ ncols
6763 Number of horizontal columns of the subplot grid.
6864 figsize : list
6965 Specify the final figure dimensions as [*width*, *height*].
@@ -96,7 +92,6 @@ def subplot(
9692 lowercase Roman numerals; use **+R** for uppercase Roman numerals [Default is
9793 Arabic numerals]. Append **+v** to increase tag numbers vertically down columns
9894 [Default is horizontally across rows].
99- $frame
10095 clearance : str or list
10196 [*side*]\ *clearance*.
10297 Reserve a space of dimension *clearance* between the margin and the
@@ -109,7 +104,6 @@ def subplot(
109104 side and 2 cm on south side). Such space will be left untouched by
110105 the main map plotting but can be accessed by methods that plot
111106 scales, bars, text, etc.
112- $projection
113107 margins
114108 Margin space that is added between neighboring subplots (i.e., the interior
115109 margins) in addition to the automatic space added for tick marks, annotations,
@@ -124,7 +118,6 @@ def subplot(
124118 The actual gap created is always a sum of the margins for the two opposing sides
125119 (e.g., east plus west or south plus north margins) [Default is half the primary
126120 annotation font size, giving the full annotation font size as the default gap].
127- $region
128121 sharex : bool or str
129122 Set subplot layout for shared x-axes. Use when all subplots in a column
130123 share a common *x*-range. If ``sharex=True``, the first (i.e.,
@@ -153,10 +146,13 @@ def subplot(
153146 - Append **+w** to the ``figsize`` or ``subsize`` parameter to draw
154147 horizontal and vertical lines between interior panels using selected
155148 pen [no lines].
156- title : str
157- While individual subplots can have titles (see ``sharex``/``sharey`` or
158- ``frame``), the entire figure may also have an overarching *heading*
159- [no heading]. Font is determined by setting :gmt-term:`FONT_HEADING`.
149+ title
150+ Set the overarching heading of the entire figure [Default is no heading]. Font
151+ is determined by :gmt-term:`FONT_HEADING`. Individual subplot can have titles
152+ set by ``sharex``/``sharey`` or ``frame``.
153+ $projection
154+ $region
155+ $frame
160156 $verbose
161157 """
162158 self ._activate_figure ()
@@ -175,6 +171,7 @@ def subplot(
175171
176172 aliasdict = AliasSystem (
177173 M = Alias (margins , name = "margins" , sep = "/" , size = (2 , 4 )),
174+ T = Alias (title , name = "title" ),
178175 ).add_common (
179176 B = frame ,
180177 J = projection ,
0 commit comments