How to import Bokeh palettes

How do I use D3 Palettes in Bokeh? I tried to import this path but I get an unresolved link error

from bokeh.palettes import Category20

      

Bokeh version:

print bokeh.__version__

0.11.1

      

+3


source to share


2 answers


Category 20 palette does not exist in bokeh 0.11.1

It is implemented in 0.12.4 (latest) and works great



from bokeh.palettes import Category20

      

Try updating it if you can.

+3


source


Category20:
{3: ['#1f77b4', '#aec7e8', '#ff7f0e'],
 4: ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78'],
 5: ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c'],
 6: ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a'],
 7: ['#1f77b4',.... ]
.
.
20: []

      

Best to use:



Category20[20][0]

      

0


source







All Articles