Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yohai committed Jun 21, 2019
1 parent fa37607 commit 813bebc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xarray/plot/facetgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .utils import (
_infer_xy_labels, _process_cmap_cbar_kwargs, import_matplotlib_pyplot,
label_from_attrs)

import xarray as xr
# Overrides axes.labelsize, xtick.major.size, ytick.major.size
# from mpl.rcParams
_FONTSIZE = 'small'
Expand Down Expand Up @@ -337,9 +337,13 @@ def _finalize_grid(self, *axlabels):
self._finalized = True

def add_legend(self, **kwargs):
if isinstance(self._hue_var, xr.DataArray):
labels = self._hue_var.values
else:
labels = self._hue_var
figlegend = self.fig.legend(
handles=self._mappables[-1],
labels=list(self._hue_var.values),
labels=list(labels),
title=self._hue_label,
loc="center right", **kwargs)

Expand Down

0 comments on commit 813bebc

Please sign in to comment.