Skip to content

Commit fdd53a6

Browse files
committed
Fix regression where legend() cannot be called without handles
1 parent 88a7e06 commit fdd53a6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

proplot/axes/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2339,7 +2339,12 @@ def _to_list(obj): # noqa: E301
23392339
# Handle lists of lists
23402340
axs = axs or ()
23412341
handles, labels = _to_list(handles), _to_list(labels)
2342-
list_of_lists = any(isinstance(h, (list, np.ndarray)) and len(h) > 1 for h in handles) # noqa: E501
2342+
if handles is None:
2343+
list_of_lists = False
2344+
else:
2345+
list_of_lists = any(
2346+
isinstance(h, (list, np.ndarray)) and len(h) > 1 for h in handles
2347+
)
23432348
if list_of_lists and ncol is not None:
23442349
warnings._warn_proplot(
23452350
'Detected list of *lists* of legend handles. '

0 commit comments

Comments
 (0)