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)