Skip to content

Commit ec9a0ea

Browse files
authored
Merge pull request #31469 from AllisonBrand/patch-1
Change if condition to allow handles to be passed as a ndarray and not only Python list or tuple, etc.
2 parents d84c7ee + e1c601d commit ec9a0ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs):
13631363
f"len(handles) = {len(handles)} "
13641364
f"len(labels) = {len(labels)}")
13651365
# if got both handles and labels as kwargs, make same length
1366-
if handles and labels:
1366+
if handles is not None and labels is not None:
13671367
handles, labels = zip(*zip(handles, labels))
13681368

13691369
elif handles is not None and labels is None:

0 commit comments

Comments
 (0)