Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pygmt/src/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def text_( # noqa: PLR0912
if name == "angle":
extra_arrays.append(np.atleast_1d(arg))
else:
extra_arrays.append(np.atleast_1d(arg).astype(str))
extra_arrays.append(np.atleast_1d(np.asarray(arg, dtype=str)))

# If an array of transparency is given, GMT will read it from the last numerical
# column per data record.
Expand All @@ -234,7 +234,7 @@ def text_( # noqa: PLR0912
kwargs["t"] = True

# Append text to the last column. Text must be passed in as str type.
text = np.atleast_1d(text).astype(str)
text = np.atleast_1d(np.asarray(text, dtype=str))
encoding = _check_encoding("".join(text))
if encoding != "ascii":
text = np.vectorize(non_ascii_to_octal, excluded="encoding")(
Expand Down
4 changes: 2 additions & 2 deletions pygmt/tests/baseline/test_text_nonstr_text.png.dvc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 7c07b7792d61e8094468eab34e8bba50
size: 12757
- md5: 41625972ee97af25965877eb78e0a673
size: 12270
path: test_text_nonstr_text.png
hash: md5