Skip to content

Commit

Permalink
Fix for non-categorical discrete color levels in bokeh
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 18, 2018
1 parent d808fa9 commit e614d66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion holoviews/plotting/bokeh/element.py
Expand Up @@ -1080,6 +1080,7 @@ def _get_colormapper(self, dim, element, ranges, style, factors=None, colors=Non
if isinstance(cmap, dict) and factors:
palette = [cmap.get(f, nan_colors.get('NaN', self._default_nan)) for f in factors]
else:
categorical = ncolors is not None
if isinstance(self.color_levels, int):
ncolors = self.color_levels
elif isinstance(self.color_levels, list):
Expand All @@ -1089,7 +1090,7 @@ def _get_colormapper(self, dim, element, ranges, style, factors=None, colors=Non
'must match the intervals defined in the '
'color_levels, expected %d colors found %d.'
% (ncolors, len(cmap)))
palette = process_cmap(cmap, ncolors, categorical=ncolors is not None)
palette = process_cmap(cmap, ncolors, categorical=categorical)
if isinstance(self.color_levels, list):
palette = color_intervals(palette, self.color_levels, clip=(low, high))
colormapper, opts = self._get_cmapper_opts(low, high, factors, nan_colors)
Expand Down

0 comments on commit e614d66

Please sign in to comment.