在散景图中的着色线(Coloring lines in a Bokeh Plot)

编程入门 行业动态 更新时间:2024-10-24 00:17:12
在散景图中的着色线(Coloring lines in a Bokeh Plot)

我有一个包含线图的散景应用程序。 这个图有10行。 如何使用相同颜色的不同色调为线条着色?

有没有什么方法可以生成相同颜色的不同色调列表而无需硬编码?

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?

最满意答案

您可以使用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)

调色板示例

http://bokeh.pydata.org/en/latest/docs/gallery/palettes.html

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

http://bokeh.pydata.org/en/latest/docs/gallery/palettes.html

更多推荐

本文发布于:2023-07-24 01:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1240107.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图中   Coloring   lines   Bokeh   Plot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!