Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yohai committed Jun 22, 2019
1 parent fa37607 commit 2bc6107
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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
1 change: 0 additions & 1 deletion xarray/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ def scatter_example_dataset():
ds.B.attrs['units'] = 'Bunits'

return ds

0 comments on commit 2bc6107

Please sign in to comment.