Skip to content

Commit df3ffdc

Browse files
committed
Figure.legend should not accept a list of spec files
1 parent 1667a0a commit df3ffdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygmt/src/legend.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
build_arg_list,
99
data_kind,
1010
fmt_docstring,
11+
is_nonstr_iter,
1112
kwargs_to_strings,
1213
use_alias,
1314
)
@@ -77,7 +78,8 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
7778
with Session() as lib:
7879
if spec is None:
7980
specfile = ""
80-
elif data_kind(spec) == "file":
81+
elif data_kind(spec) == "file" and not is_nonstr_iter(spec):
82+
# Is a file but not a list of files
8183
specfile = spec
8284
else:
8385
raise GMTInvalidInput(f"Unrecognized data type: {type(spec)}")

0 commit comments

Comments
 (0)