Skip to content

Commit

Permalink
Figure.legend should not accept a list of spec files
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Apr 8, 2024
1 parent 1667a0a commit df3ffdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pygmt/src/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
build_arg_list,
data_kind,
fmt_docstring,
is_nonstr_iter,
kwargs_to_strings,
use_alias,
)
Expand Down Expand Up @@ -77,7 +78,8 @@ def legend(self, spec=None, position="JTR+jTR+o0.2c", box="+gwhite+p1p", **kwarg
with Session() as lib:
if spec is None:
specfile = ""
elif data_kind(spec) == "file":
elif data_kind(spec) == "file" and not is_nonstr_iter(spec):
# Is a file but not a list of files
specfile = spec
else:
raise GMTInvalidInput(f"Unrecognized data type: {type(spec)}")
Expand Down

0 comments on commit df3ffdc

Please sign in to comment.