From 578b37b5ef8e88587fb8505a880d2ed91cb77c68 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Sun, 4 Aug 2024 18:38:42 +0800 Subject: [PATCH] For a dict, need to apply np.atleast_1d to make sure the value is an array --- pygmt/clib/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/clib/session.py b/pygmt/clib/session.py index 4004e563cd5..7e74219937f 100644 --- a/pygmt/clib/session.py +++ b/pygmt/clib/session.py @@ -1729,7 +1729,7 @@ def virtualfile_in( # noqa: PLR0912 if hasattr(data, "items") and not hasattr(data, "to_frame"): # Dict, pandas.DataFrame or xarray.Dataset types. # pandas.Series will be handled below like a 1-D numpy.ndarray. - _data = [array for _, array in data.items()] + _data = [np.atleast_1d(array) for _, array in data.items()] else: # Python list, tuple, and pandas.Series types _data = np.atleast_2d(np.asanyarray(data).T)