Skip to content

Commit

Permalink
Fixed issues with matplotlib AxesImage legend
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 5, 2019
1 parent c59d074 commit 9ce56a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions holoviews/plotting/mpl/element.py
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

0 comments on commit 9ce56a2

Please sign in to comment.