22text - Plot text on a figure.
33"""
44
5+ from collections .abc import Sequence
6+
57import numpy as np
8+ from pygmt ._typing import AnchorCode
69from pygmt .clib import Session
710from pygmt .exceptions import GMTInvalidInput
811from pygmt .helpers import (
@@ -44,11 +47,11 @@ def text_( # noqa: PLR0912
4447 textfiles = None ,
4548 x = None ,
4649 y = None ,
47- position = None ,
50+ position : AnchorCode | None = None ,
4851 text = None ,
4952 angle = None ,
5053 font = None ,
51- justify = None ,
54+ justify : bool | None | AnchorCode | Sequence [ AnchorCode ] = None ,
5255 ** kwargs ,
5356):
5457 r"""
@@ -90,14 +93,14 @@ def text_( # noqa: PLR0912
9093 x/y : float or 1-D arrays
9194 The x and y coordinates, or an array of x and y coordinates to plot
9295 the text.
93- position : str
96+ position
9497 Set reference point on the map for the text by using x, y
9598 coordinates extracted from ``region`` instead of providing them
9699 through ``x``/``y``. Specify with a two-letter (order independent)
97100 code, chosen from:
98101
99- * Horizontal: **L**\ (eft), **C**\ (entre), **R**\ (ight)
100102 * Vertical: **T**\ (op), **M**\ (iddle), **B**\ (ottom)
103+ * Horizontal: **L**\ (eft), **C**\ (entre), **R**\ (ight)
101104
102105 For example, ``position="TL"`` plots the text at the Top Left corner
103106 of the map.
@@ -116,7 +119,7 @@ def text_( # noqa: PLR0912
116119 font. If no font info is explicitly given (i.e. ``font=True``), then
117120 the input to ``textfiles`` must have this information in one of its
118121 columns.
119- justify : str, bool or list of str
122+ justify
120123 Set the alignment which refers to the part of the text string that
121124 will be mapped onto the (x, y) point. Choose a two-letter
122125 combination of **L**, **C**, **R** (for left, center, or right) and
0 commit comments