繁体   English   中英

将图中的图例设置为散景中的列名称

[英]Set the legend in a plot to have the name of a column in bokeh

下面是我的代码,如何让图例采用 rf.index[0] 中列的名称。 简单地将 rf.index[0] 传递给图例会创建类别的图例,而不是列的实际名称。

p1.line(
    x = 'x',
    y = rf.index[0],
    source=source,
    legend = ???,
    color = 'black'

)

这是答案!

legend = dict(value=rf.index[0])

来源

https://github.com/bokeh/bokeh/issues/5365

暂无
暂无

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

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