我有一个包含多条线的图表,如下所示:
p=figure()
p.line(x,y)
p.line(x1,y1)
p.line(x2,y2)
有没有一种简单的方法可以在事实结束后向所有行添加选项,而不是在每次插入时都重复它们?
例如p.lines(line_width = 2,line_alpha=0.2)
谢谢!
您可以设置theme:
from bokeh.io import curdoc,show
from bokeh.plotting import figure
from bokeh.themes import Theme
p = figure()
p.line([1,2,3],[4,5,6],color="red")
p.line([1,[6,4],color="blue")
curdoc().theme = Theme(json={
'attrs': {
'Line': { 'line_width': 10,'line_alpha': 0.2,},}
})
show(p)