Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues with matplotlib AxesImage legend #4031

Merged
merged 1 commit into from
Oct 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions holoviews/plotting/mpl/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from matplotlib import ticker
from matplotlib.dates import date2num
from matplotlib.image import AxesImage

from ...core import util
from ...core import (OrderedDict, NdOverlay, DynamicMap, Dataset,
Expand Down Expand Up @@ -1054,6 +1055,9 @@ def _adjust_legend(self, overlay, axis):
for handle, label in zip(all_handles, all_labels):
# Ensure that artists with multiple handles are supported
if isinstance(handle, list): handle = tuple(handle)
handle = tuple(h for h in handle if not isinstance(h, AxesImage))
if not handle:
continue
if handle and (handle not in data) and label and label not in used_labels:
data[handle] = label
used_labels.append(label)
Expand Down