Skip to content

Commit c75dc72

Browse files
authored
Figure.text: Fix the checking of parameters 'font' and 'angle' (#4577)
1 parent 316dddc commit c75dc72

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pygmt/src/text.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
it="use_word",
3333
w="wrap",
3434
)
35-
def text_( # noqa: PLR0912, PLR0913
35+
def text_( # noqa: PLR0912, PLR0913, PLR0915
3636
self,
3737
textfiles: PathLike | TableLike | None = None,
3838
x=None,
@@ -118,12 +118,12 @@ def text_( # noqa: PLR0912, PLR0913
118118
of the map.
119119
text
120120
The text string, or an array of strings to plot on the figure.
121-
angle: float, str, bool or list
121+
angle
122122
Set the angle measured in degrees counter-clockwise from
123123
horizontal (e.g. 30 sets the text at 30 degrees). If no angle is
124124
explicitly given (i.e. ``angle=True``) then the input to ``textfiles``
125125
must have this as a column.
126-
font : str, bool or list of str
126+
font
127127
Set the font specification with format *size*\ ,\ *font*\ ,\ *color*
128128
where *size* is text size in points, *font* is the font to use, and
129129
*color* sets the font color. For example,
@@ -228,13 +228,15 @@ def text_( # noqa: PLR0912, PLR0913
228228

229229
# Build the -F option.
230230
if kwargs.get("F") is None and any(
231-
v is not None for v in (position, angle, font, justify)
231+
v is not None or v is not False for v in (position, angle, font, justify)
232232
):
233233
kwargs.update({"F": ""})
234234

235235
for arg, flag, _ in array_args:
236236
if arg is True:
237237
kwargs["F"] += flag
238+
elif arg is False:
239+
pass
238240
elif isinstance(arg, int | float | str):
239241
kwargs["F"] += f"{flag}{arg}"
240242

0 commit comments

Comments
 (0)