Skip to content

Commit 3da5afd

Browse files
Merge branch 'main' into add-tut-legend-l
2 parents ef192fe + 21b2d46 commit 3da5afd

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191

9292
steps:
9393
- name: Download all the dists
94-
uses: actions/download-artifact@v6.0.0
94+
uses: actions/download-artifact@v7.0.0
9595
with:
9696
name: python-package-distributions
9797
path: dist/
@@ -115,7 +115,7 @@ jobs:
115115

116116
steps:
117117
- name: Download all the dists
118-
uses: actions/download-artifact@v6.0.0
118+
uses: actions/download-artifact@v7.0.0
119119
with:
120120
name: python-package-distributions
121121
path: dist/

.github/workflows/slash-command-dispatch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Slash Command Dispatch
24-
uses: peter-evans/slash-command-dispatch@13bc09769d122a64f75aa5037256f6f2d78be8c4 # v4.0.0
24+
uses: peter-evans/slash-command-dispatch@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
2525
with:
2626
token: ${{ github.token }}
2727
commands: |

pygmt/src/subplot.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
from pygmt.alias import Alias, AliasSystem
1010
from pygmt.clib import Session
1111
from 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
@@ -26,14 +21,14 @@
2621
C="clearance",
2722
SC="sharex",
2823
SR="sharey",
29-
T="title",
3024
)
3125
@kwargs_to_strings(Ff="sequence", Fs="sequence")
3226
def 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

Comments
 (0)