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/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,9 +1809,9 @@ def virtualfile_in( # noqa: PLR0912
warnings.warn(message=msg, category=RuntimeWarning, stacklevel=2)
_data = (data,) if not isinstance(data, pathlib.PurePath) else (str(data),)
elif kind == "vectors":
_data = [np.atleast_1d(x), np.atleast_1d(y)]
_data = [x, y]
if z is not None:
_data.append(np.atleast_1d(z))
_data.append(z)
if extra_arrays:
_data.extend(extra_arrays)
elif kind == "matrix": # turn 2-D arrays into list of vectors
Expand Down
10 changes: 5 additions & 5 deletions pygmt/src/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ def text_( # noqa: PLR0912
kwargs["F"] += flag
# angle is numeric type and font/justify are str type.
if name == "angle":
extra_arrays.append(np.atleast_1d(arg))
extra_arrays.append(arg)
else:
extra_arrays.append(np.atleast_1d(np.asarray(arg, dtype=str)))
extra_arrays.append(np.asarray(arg, dtype=str))

# If an array of transparency is given, GMT will read it from the last numerical
# column per data record.
if is_nonstr_iter(kwargs.get("t")):
extra_arrays.append(np.atleast_1d(kwargs["t"]))
extra_arrays.append(kwargs["t"])
kwargs["t"] = True

# Append text to the last column. Text must be passed in as str type.
text = np.atleast_1d(np.asarray(text, dtype=str))
encoding = _check_encoding("".join(text))
text = np.asarray(text, dtype=str)
encoding = _check_encoding("".join(text.flatten()))
if encoding != "ascii":
text = np.vectorize(non_ascii_to_octal, excluded="encoding")(
text, encoding=encoding
Expand Down