【发布时间】:2017-06-30 23:23:00
【问题描述】:
我正在尝试输出一个折线图,其中破折号由数据驱动。我的例子是:
from bokeh.plotting import figure, output_notebook, show
output_notebook()
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
z = ['dashed', 'dashed', 'dashed', 'solid', 'solid']
p = figure(plot_width=400, plot_height=400)
p.line(x, y, line_width=2, line_dash=z)
show(p)
但是,这会导致:
ValueError: 期望 Enum('solid', 'dashed', 'dotted', 'dotdash', 'dashdot'), Regex('^(\d+(\s+\d+)*)?$ ') 或 Seq(Int),得到 ['dashed', 'dashed', 'dashed', 'solid', 'solid']
是否可以根据我的数据集设置线型?
【问题讨论】:
标签: bokeh