If you use the higher level bokeh.plotting interface, you can pass a list of colors as you have tried:
p = figure()
p.multi_line("xs", "ys", line_color=['#8dd3c7','#ffffb3'], line_width=2)
The bokeh.plotting hides some of the work. In particular it takes the list of colors you pass in and puts it in a column data source and wires everything up correctly.
However, you are using the lowest-leve bokeh.models interface. Here, you are setting attributes on the glyph object directly. The color attribute only accepts i) a single color value, or ii) the name of a column in a column data source with the color data. So to use this low level interface, you will need to put the colors in the column data source yourself, and then set "line_color" to be then name of the column with the color data.
Odd, its working now, but I’m not sure why it wasn’t before.
I am now getting the following error. Is it safe to ignore?:
No handlers could be found for logger “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bokeh/validation/check.pyc”
``
On to working with the legend! Thanks!
···
On Tuesday, July 7, 2015 at 3:28:38 PM UTC-4, Bryan Van de ven wrote:
If you use the higher level bokeh.plotting interface, you can pass a list of colors as you have tried:
p = figure()
p.multi_line("xs", "ys", line_color=['#8dd3c7','#ffffb3'], line_width=2)
The bokeh.plotting hides some of the work. In particular it takes the list of colors you pass in and puts it in a column data source and wires everything up correctly.
However, you are using the lowest-leve bokeh.models interface. Here, you are setting attributes on the glyph object directly. The color attribute only accepts i) a single color value, or ii) the name of a column in a column data source with the color data. So to use this low level interface, you will need to put the colors in the column data source yourself, and then set “line_color” to be then name of the column with the color data.