0
我想使用ColumnDataSource设置散景线阴影(散景版本0.12.5)的颜色。但是,对于一个线图,没有任何东西是绘制的。另一方面,如果我使用圆形渲染器,一切都按预期工作。下面是一个带有线图和圆形图的示例程序,您可以评论/取消注释相应的行以查看绘图行为。我还为线图绘制了一行代码,其中明确定义了颜色并且绘图完美无缺。我已经看到了一些类似的问题,但是找不到解决这个问题的可靠解决方案,或者确定我是否正在做一些根本性错误。谢谢你的帮助。ColumnDataSource中的散焦线阴谋颜色
# bokeh version 0.12.5
# run in terminal with: python -m bokeh serve --show line_plot_color.py
from bokeh.io import curdoc
from bokeh.models import ColumnDataSource
from bokeh.plotting import Figure
from bokeh.layouts import row
source = ColumnDataSource(data = dict(color = ['green','green','green'], xs = [1,2,3], ys = [1,2,3]))
fig = Figure(plot_width=300, plot_height=300)
#r = fig.circle('xs','ys',source = source, size = 12, fill_color = 'color') # works as expected
r = fig.line('xs','ys',source = source, line_color = 'color') # fails to plot; no errors or warnings in terminal
#r = fig.line('xs','ys',source = source, line_color = 'green') # works as expected
layout = row(fig)
curdoc().add_root(layout)