Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coloring lines in a Bokeh Plot

I have a Bokeh App that contains a Line Plot. This plot has 10 lines in it. How do I color the lines with different shades of the same color?

Is there any way I can generate a list of different shades of the same color without hardcoding it?

like image 320
van_d39 Avatar asked Jun 02 '26 11:06

van_d39


1 Answers

You could use a palette from bokeh.palettes:

from bokeh.plotting import figure, output_file, show
from bokeh.palettes import Blues9

output_file('palette.html')

p = figure()
p.scatter(x=[0,1,2,3,4,5,6,7,8], y=[0,1,2,3,4,5,6,7,8], radius=1, fill_color=Blues9)

show(p)

Palette Example

https://docs.bokeh.org/en/latest/docs/reference/palettes.html

like image 195
Luke Canavan Avatar answered Jun 05 '26 02:06

Luke Canavan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!