2
2
text - Plot text on a figure.
3
3
"""
4
4
5
+ from collections .abc import Sequence
6
+
5
7
import numpy as np
8
+ from pygmt ._typing import AnchorCode
6
9
from pygmt .clib import Session
7
10
from pygmt .exceptions import GMTInvalidInput
8
11
from pygmt .helpers import (
@@ -44,11 +47,11 @@ def text_( # noqa: PLR0912
44
47
textfiles = None ,
45
48
x = None ,
46
49
y = None ,
47
- position = None ,
50
+ position : AnchorCode | None = None ,
48
51
text = None ,
49
52
angle = None ,
50
53
font = None ,
51
- justify = None ,
54
+ justify : bool | None | AnchorCode | Sequence [ AnchorCode ] = None ,
52
55
** kwargs ,
53
56
):
54
57
r"""
@@ -90,14 +93,14 @@ def text_( # noqa: PLR0912
90
93
x/y : float or 1-D arrays
91
94
The x and y coordinates, or an array of x and y coordinates to plot
92
95
the text.
93
- position : str
96
+ position
94
97
Set reference point on the map for the text by using x, y
95
98
coordinates extracted from ``region`` instead of providing them
96
99
through ``x``/``y``. Specify with a two-letter (order independent)
97
100
code, chosen from:
98
101
99
- * Horizontal: **L**\ (eft), **C**\ (entre), **R**\ (ight)
100
102
* Vertical: **T**\ (op), **M**\ (iddle), **B**\ (ottom)
103
+ * Horizontal: **L**\ (eft), **C**\ (entre), **R**\ (ight)
101
104
102
105
For example, ``position="TL"`` plots the text at the Top Left corner
103
106
of the map.
@@ -116,7 +119,7 @@ def text_( # noqa: PLR0912
116
119
font. If no font info is explicitly given (i.e. ``font=True``), then
117
120
the input to ``textfiles`` must have this information in one of its
118
121
columns.
119
- justify : str, bool or list of str
122
+ justify
120
123
Set the alignment which refers to the part of the text string that
121
124
will be mapped onto the (x, y) point. Choose a two-letter
122
125
combination of **L**, **C**, **R** (for left, center, or right) and
0 commit comments