# Buggy code
def get_data(self, element, ranges, style):
    data, mapping, style = HistogramPlot.get_data(self, element, ranges, style)
    color_dims = [
        d
        for d in self.adjoined.traverse(lambda x: x.handles.get("color_dim"))
        if d is not None
    ]
    dim = color_dims[0] if color_dims else None
    cmapper = self._get_colormapper(dim, element, {}, {})
    if cmapper and dim in element.dimensions():
        data[dim.name] = [] if self.static_source else element.dimension_values(dim)
        mapping["fill_color"] = {"field": dim.name, "transform": cmapper}
    return (data, mapping, style)


# Traceback (KeyError)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/miniconda3/envs/py37/lib/python3.7/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968
969             if method is not None:
--> 970                 return method(include=include, exclude=exclude)
971             return None
972         else:

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/core/dimension.py in _repr_mimebundle_(self, include, exclude)
1302         combined and returned.
1303         """
-> 1304         return Store.render(self)
1305
1306

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/core/options.py in render(cls, obj)
1393         data, metadata = {}, {}
1394         for hook in hooks:
-> 1395             ret = hook(obj)
1396             if ret is None:
1397                 continue

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)
280     if not ip.display_formatter.formatters['text/plain'].pprint:
281         return None
--> 282     return display(obj, raw_output=True)
283
284

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw_output, **kwargs)
250     elif isinstance(obj, (CompositeOverlay, ViewableElement)):
251         with option_state(obj):
--> 252             output = element_display(obj)
253     elif isinstance(obj, (Layout, NdLayout, AdjointLayout)):
254         with option_state(obj):

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)
144         try:
145             max_frames = OutputSettings.options['max_frames']
--> 146             mimebundle = fn(element, max_frames=max_frames)
147             if mimebundle is None:
148                 return {}, {}

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/ipython/display_hooks.py in element_display(element, max_frames)
190         return None
191
--> 192     return render(element)
193
194

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)
66         renderer = renderer.instance(fig='png')
67
---> 68     return renderer.components(obj, **kwargs)
69
70

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/renderer.py in components(self, obj, fmt, comm, **kwargs)
353             plot = obj
354         else:
--> 355             plot, fmt = self._validate(obj, fmt)
356
357         data, metadata = {}, {}

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/renderer.py in _validate(self, obj, fmt, **kwargs)
278                                  renderer=self)
279         else:
--> 280             plot = self.get_plot(obj, renderer=self, **kwargs)
281
282         all_formats = set(fig_formats + holomap_formats)

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
221             init_key = tuple(v if d is None else d for v, d in
222                              zip(plot.keys[0], defaults))
--> 223             plot.update(init_key)
224         else:
225             plot = obj

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/mpl/plot.py in update(self, key)
257     def update(self, key):
258         if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 259             return self.initialize_plot()
260         return self.__getitem__(key)
261

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/mpl/plot.py in wrapper(self, *args, **kwargs)
53     def wrapper(self, *args, **kwargs):
54         with _rc_context(self.fig_rcparams):
---> 55             return f(self, *args, **kwargs)
56     return wrapper
57

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/mpl/element.py in initialize_plot(self, ranges)
508             style['label'] = element.label
509
--> 510         plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style)
511
512         with abbreviated_exception():

~/miniconda3/envs/py37/lib/python3.7/site-packages/holoviews/plotting/mpl/path.py in get_data(self, element, ranges, style)
66         if not (self.color_index or style_mapping):
67             if cdim:
---> 68                 style['array'] = style.pop('c')
69                 style['clim'] = style.pop('vmin', None), style.pop('vmax', None)
70             return (paths,), style, {'dimensions': dims}

KeyError: 'c'

# Fixed code
def get_data(self, element, ranges, style):
    data, mapping, style = HistogramPlot.get_data(self, element, ranges, style)
    color_dims = [
        d
        for d in self.adjoined.traverse(lambda x: x.handles.get("color_dim"))
        if d is not None
    ]
    dimension = color_dims[0] if color_dims else None
    cmapper = self._get_colormapper(dimension, element, {}, {})
    if cmapper and dimension in element.dimensions():
        if isinstance(dimension, dim):
            dim_name = dimension.dimension.name
            data[dim_name] = [] if self.static_source else dimension.apply(element)
        else:
            dim_name = dimension.name
            data[dim_name] = (
                [] if self.static_source else element.dimension_values(dimension)
            )
        mapping["fill_color"] = {"field": dim_name, "transform": cmapper}
    return (data, mapping, style)