Skip to content

Commit b1737f7

Browse files
authored
Figure.legend: Add aliases for -S (scale) and -B (frame) (#4254)
1 parent 8b94170 commit b1737f7

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pygmt/src/legend.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222

2323
@fmt_docstring
2424
@use_alias(D="position")
25-
def legend(
25+
def legend( # noqa: PLR0913
2626
self,
2727
spec: PathLike | io.StringIO | None = None,
28-
projection: str | None = None,
29-
region: Sequence[float | str] | str | None = None,
28+
scale: float | None = None,
3029
position="JTR+jTR+o0.2c",
3130
box: Box | bool = False,
31+
projection: str | None = None,
32+
region: Sequence[float | str] | str | None = None,
33+
frame: str | Sequence[str] | bool = False,
3234
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
3335
| bool = False,
3436
panel: int | Sequence[int] | bool = False,
@@ -48,9 +50,11 @@ def legend(
4850
Full GMT docs at :gmt-docs:`legend.html`.
4951
5052
$aliases
53+
- B = frame
5154
- F = box
5255
- J = projection
5356
- R = region
57+
- S = scale
5458
- V = verbose
5559
- c = panel
5660
- p = perspective
@@ -67,8 +71,6 @@ def legend(
6771
- A :class:`io.StringIO` object containing the legend specification
6872
6973
See :gmt-docs:`legend.html` for the definition of the legend specification.
70-
$projection
71-
$region
7274
position : str
7375
[**g**\|\ **j**\|\ **J**\|\ **n**\|\ **x**]\ *refpoint*\
7476
**+w**\ *width*\ [/*height*]\ [**+j**\ *justify*]\ [**+l**\ *spacing*]\
@@ -82,6 +84,11 @@ def legend(
8284
rectangular box is drawn using :gmt-term:`MAP_FRAME_PEN`. To customize the box
8385
appearance, pass a :class:`pygmt.params.Box` object to control style, fill, pen,
8486
and other box properties.
87+
scale
88+
Scale all symbol sizes by a common scale [Default is 1.0, i.e., no scaling].
89+
$projection
90+
$region
91+
$frame
8592
$verbose
8693
$panel
8794
$perspective
@@ -105,7 +112,9 @@ def legend(
105112

106113
aliasdict = AliasSystem(
107114
F=Alias(box, name="box"),
115+
S=Alias(scale, name="scale"),
108116
).add_common(
117+
B=frame,
109118
J=projection,
110119
R=region,
111120
V=verbose,

0 commit comments

Comments
 (0)