简体   繁体   English

散景图中的着色线

[英]Coloring lines in a Bokeh Plot

I have a Bokeh App that contains a Line Plot.我有一个包含线图的散景应用程序。 This plot has 10 lines in it.该图中有 10 行。 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?有什么方法可以生成相同颜色的不同色调的列表而无需对其进行硬编码?

You could use a palette from bokeh.palettes:您可以使用 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)

调色板示例

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM