From a938d244d011bb4c2e94e663ed233de82037e713 Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 15 Dec 2018 15:44:13 -0800 Subject: [PATCH] fix tests. --- xarray/plot/plot.py | 2 +- xarray/plot/utils.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/xarray/plot/plot.py b/xarray/plot/plot.py index a650722515d..0e44f75d6c6 100644 --- a/xarray/plot/plot.py +++ b/xarray/plot/plot.py @@ -831,9 +831,9 @@ def newplotfunc(darray, x=None, y=None, figsize=None, size=None, ax.set_title(darray._title_for_slice()) if add_colorbar: + cbar_kwargs = {} if cbar_kwargs is None else dict(cbar_kwargs) if add_labels and 'label' not in cbar_kwargs: cbar_kwargs['label'] = label_from_attrs(darray) - cbar = _add_colorbar(primitive, ax, cbar_ax, cbar_kwargs, cmap_params) diff --git a/xarray/plot/utils.py b/xarray/plot/utils.py index 943b454bc87..016c6b5b395 100644 --- a/xarray/plot/utils.py +++ b/xarray/plot/utils.py @@ -489,7 +489,6 @@ def _ensure_numeric(arr): def _add_colorbar(primitive, ax, cbar_ax, cbar_kwargs, cmap_params): plt = import_matplotlib_pyplot() - cbar_kwargs = {} if cbar_kwargs is None else dict(cbar_kwargs) cbar_kwargs.setdefault('extend', cmap_params['extend']) if cbar_ax is None: cbar_kwargs.setdefault('ax', ax)