You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the code below using Jupyter notebook
with holoviews version 1.14.3
Description of expected behavior and the observed behavior
The code below is working as expected (see screen capture). But when I modify the plotting function to add the colorbar I get the error listed at the bottom.
_---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\Anaconda3\lib\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:
~\Anaconda3\lib\site-packages\panel\viewable.py in repr_mimebundle(self, include, exclude)
571 doc = _Document()
572 comm = state._comm_manager.get_server_comm()
--> 573 model = self._render_model(doc, comm)
574 ref = model.ref['id']
575 manager = CommManager(comm_id=comm.id, plot_id=ref)
~\Anaconda3\lib\site-packages\panel\viewable.py in _render_model(self, doc, comm)
422 if comm is None:
423 comm = state._comm_manager.get_server_comm()
--> 424 model = self.get_root(doc, comm)
425
426 if config.embed:
~\Anaconda3\lib\site-packages\holoviews\plotting\renderer.py in get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
241 init_key = tuple(v if d is None else d for v, d in
242 zip(plot.keys[0], defaults))
--> 243 plot.update(init_key)
244 else:
245 plot = obj
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\plot.py in update(self, key)
249 def update(self, key):
250 if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 251 return self.initialize_plot()
252 return self.getitem(key)
253
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\element.py in _finalize_axis(self, key, element, title, dimensions, ranges, xticks, yticks, zticks, xlabel, ylabel, zlabel)
191
192 if not subplots and not self.drawn:
--> 193 self._finalize_artist(element)
194
195 self._execute_hooks(element)
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\element.py in _finalize_artist(self, element)
774 dims = [h for k, h in self.handles.items() if k.endswith('color_dim')]
775 for d in dims:
--> 776 self._draw_colorbar(element, d)
777
778
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\chart3d.py in _draw_colorbar(self, element, dim, redraw)
102 dim = element.get_dimension(2)
103 elif not isinstance(dim, Dimension):
--> 104 dim = element.get_dimension(dim)
105 label = dim.pprint_label
106 cbar = fig.colorbar(artist, shrink=0.7, ax=ax)
~\Anaconda3\lib\site-packages\holoviews\core\dimension.py in get_dimension(self, dimension, default, strict)
960 """
961 if dimension is not None and not isinstance(dimension, (int, basestring, Dimension)):
--> 962 raise TypeError('Dimension lookup supports int, string, '
963 'and Dimension instances, cannot lookup '
964 'Dimensions using %s type.' % type(dimension).name)
TypeError: Dimension lookup supports int, string, and Dimension instances, cannot lookup Dimensions using dim type.
ALL software version info
I am running the code below using Jupyter notebook
with holoviews version 1.14.3
Description of expected behavior and the observed behavior
The code below is working as expected (see screen capture). But when I modify the plotting function to add the colorbar I get the error listed at the bottom.
Complete, minimal, self-contained example code that reproduces the issue
Traceback in the Jupyter notebook
_---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\Anaconda3\lib\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:
~\Anaconda3\lib\site-packages\panel\viewable.py in repr_mimebundle(self, include, exclude)
571 doc = _Document()
572 comm = state._comm_manager.get_server_comm()
--> 573 model = self._render_model(doc, comm)
574 ref = model.ref['id']
575 manager = CommManager(comm_id=comm.id, plot_id=ref)
~\Anaconda3\lib\site-packages\panel\viewable.py in _render_model(self, doc, comm)
422 if comm is None:
423 comm = state._comm_manager.get_server_comm()
--> 424 model = self.get_root(doc, comm)
425
426 if config.embed:
~\Anaconda3\lib\site-packages\panel\viewable.py in get_root(self, doc, comm, preprocess)
480 """
481 doc = init_doc(doc)
--> 482 root = self._get_model(doc, comm=comm)
483 if preprocess:
484 self._preprocess(root)
~\Anaconda3\lib\site-packages\panel\layout\base.py in _get_model(self, doc, root, parent, comm)
110 if root is None:
111 root = model
--> 112 objects = self._get_objects(model, [], doc, root, comm)
113 props = dict(self._init_properties(), objects=objects)
114 model.update(**self._process_param_change(props))
~\Anaconda3\lib\site-packages\panel\layout\base.py in _get_objects(self, model, old_objects, doc, root, comm)
100 else:
101 try:
--> 102 child = pane._get_model(doc, root, model, comm)
103 except RerenderError:
104 return self._get_objects(model, current_objects[:i], doc, root, comm)
~\Anaconda3\lib\site-packages\panel\pane\base.py in _get_model(self, doc, root, parent, comm)
408 if ref in self._models:
409 self._cleanup(root)
--> 410 model = self._inner_layout._get_model(doc, root, parent, comm)
411 if root is None:
412 ref = model.ref['id']
~\Anaconda3\lib\site-packages\panel\layout\base.py in _get_model(self, doc, root, parent, comm)
110 if root is None:
111 root = model
--> 112 objects = self._get_objects(model, [], doc, root, comm)
113 props = dict(self._init_properties(), objects=objects)
114 model.update(**self._process_param_change(props))
~\Anaconda3\lib\site-packages\panel\layout\base.py in _get_objects(self, model, old_objects, doc, root, comm)
100 else:
101 try:
--> 102 child = pane._get_model(doc, root, model, comm)
103 except RerenderError:
104 return self._get_objects(model, current_objects[:i], doc, root, comm)
~\Anaconda3\lib\site-packages\panel\pane\holoviews.py in _get_model(self, doc, root, parent, comm)
239 plot = self.object
240 else:
--> 241 plot = self._render(doc, comm, root)
242
243 plot.pane = self
~\Anaconda3\lib\site-packages\panel\pane\holoviews.py in _render(self, doc, comm, root)
304 kwargs['comm'] = comm
305
--> 306 return renderer.get_plot(self.object, **kwargs)
307
308 def _cleanup(self, root):
~\Anaconda3\lib\site-packages\holoviews\plotting\renderer.py in get_plot(self_or_cls, obj, doc, renderer, comm, **kwargs)
241 init_key = tuple(v if d is None else d for v, d in
242 zip(plot.keys[0], defaults))
--> 243 plot.update(init_key)
244 else:
245 plot = obj
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\plot.py in update(self, key)
249 def update(self, key):
250 if len(self) == 1 and ((key == 0) or (key == self.keys[0])) and not self.drawn:
--> 251 return self.initialize_plot()
252 return self.getitem(key)
253
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\plot.py in wrapper(self, *args, **kwargs)
45 def wrapper(self, *args, **kwargs):
46 with _rc_context(self.fig_rcparams):
---> 47 return f(self, *args, **kwargs)
48 return wrapper
49
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\element.py in initialize_plot(self, ranges)
522 Stream.trigger(trigger)
523
--> 524 return self._finalize_axis(self.keys[-1], element=element, ranges=ranges,
525 **axis_kwargs)
526
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\chart3d.py in _finalize_axis(self, key, **kwargs)
85 else:
86 axis.set_facecolor(self.bgcolor)
---> 87 return super(Plot3D, self)._finalize_axis(key, **kwargs)
88
89
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\element.py in _finalize_axis(self, key, element, title, dimensions, ranges, xticks, yticks, zticks, xlabel, ylabel, zlabel)
191
192 if not subplots and not self.drawn:
--> 193 self._finalize_artist(element)
194
195 self._execute_hooks(element)
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\element.py in _finalize_artist(self, element)
774 dims = [h for k, h in self.handles.items() if k.endswith('color_dim')]
775 for d in dims:
--> 776 self._draw_colorbar(element, d)
777
778
~\Anaconda3\lib\site-packages\holoviews\plotting\mpl\chart3d.py in _draw_colorbar(self, element, dim, redraw)
102 dim = element.get_dimension(2)
103 elif not isinstance(dim, Dimension):
--> 104 dim = element.get_dimension(dim)
105 label = dim.pprint_label
106 cbar = fig.colorbar(artist, shrink=0.7, ax=ax)
~\Anaconda3\lib\site-packages\holoviews\core\dimension.py in get_dimension(self, dimension, default, strict)
960 """
961 if dimension is not None and not isinstance(dimension, (int, basestring, Dimension)):
--> 962 raise TypeError('Dimension lookup supports int, string, '
963 'and Dimension instances, cannot lookup '
964 'Dimensions using %s type.' % type(dimension).name)
TypeError: Dimension lookup supports int, string, and Dimension instances, cannot lookup Dimensions using dim type.
Row(sizing_mode='stretch_width')
[0] ParamFunction(function)
[1] Column
[0] IntSlider(end=180, name='azimuth', start=-180, value=60, value_throttled=60)
[1] IntSlider(end=90, name='elevation', value=20, value_throttled=20)_
The text was updated successfully, but these errors were encountered: