From 03341f7062208d7e07797188dddacb0d7dd6bd81 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Sat, 25 Feb 2017 22:18:49 +0000
Subject: [PATCH] Fixed issue with no colorbar dimension and unicode label
---
holoviews/plotting/mpl/element.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/holoviews/plotting/mpl/element.py b/holoviews/plotting/mpl/element.py
index 08b5ca27da..0323f17361 100644
--- a/holoviews/plotting/mpl/element.py
+++ b/holoviews/plotting/mpl/element.py
@@ -600,9 +600,12 @@ def _draw_colorbar(self, dim=None, redraw=True):
# Get colorbar label
dim = element.get_dimension(dim)
- if dim is None:
- dim = element.vdims[0]
- label = str(dim)
+ if dim:
+ label = dim.pprint_label
+ elif element.vdims:
+ label = element.vdims[0].pprint_label
+ elif dim is None:
+ label = ''
padding = self.cbar_padding
width = self.cbar_width