Skip to content

Commit

Permalink
Add warning message when users pass invalid legend handles
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Sep 5, 2021
1 parent 85c13e4 commit b75ca18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proplot/axes/base.py
Expand Up @@ -2424,6 +2424,8 @@ def _legend_tuple(*objs): # noqa: E306
handles.append(obj)
elif hasattr(obj, 'get_label'):
handles.append(obj)
else:
warnings._warn_proplot(f'Ignoring invalid legend handle {obj!r}.')
return tuple(handles)

# Sanitize labels. Ignore e.g. extra hist() or hist2d() return values,
Expand Down

0 comments on commit b75ca18

Please sign in to comment.