Skip to content

Commit a9d094c

Browse files
committed
Fix legend as now 'vectors' doesn't mean data is None
1 parent 9891b2c commit a9d094c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pygmt/src/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def legend(
9191
kwargs["F"] = box
9292

9393
kind = data_kind(spec)
94-
if kind not in {"vectors", "file", "stringio"}: # kind="vectors" means spec is None
94+
if spec is not None and kind not in {"file", "stringio"}:
9595
raise GMTInvalidInput(f"Unrecognized data type: {type(spec)}")
9696
if kind == "file" and is_nonstr_iter(spec):
9797
raise GMTInvalidInput("Only one legend specification file is allowed.")

0 commit comments

Comments
 (0)