Closed ktrapeznikov closed 5 years ago
Does the same problem occur if you change it to this?
%%opts Path [colorbar=True] (cmap="blues" line_width=3 color='highway')
Since holoviews 1.11 was released the *_index
options are now considered deprecated and data dimensions can now be mapped directly to style options.
Yep. That fixed it! Thanks.
However, colorbar still does not show for categorical values.
Bokeh does not support colorbars for categorical values, it should however support a legend. Does %%opts Path [show_legend=True]
work?
Yep. I had to remove label="roads"
from the Path declaration. Otherwise the only legend was "roads".
Yep. I had to remove label="roads" from the Path declaration. Otherwise the only legend was "roads".
The more specific legend should probably take precedence so that isn't necessary, but that's an issue to raise in holoviews.
color_index
forPath
objects only works for number-like fields not categorical fields like stringsI want to color paths by a categorical value stored as a string in a GeoPandas data frame. Here is an example data frame of road segments stored as LineStrings:
I want to color each path according to the
highway
type.If I do, I get the following error:
(Sorry for the long error message).
If change the color_index to
color_field
a float then everything works fine.versions: