我想使用循环来加载和/或修改数据,并在循环中使用Bokeh绘制结果(我熟悉Matplotlib的axes.color_cycle
)。这是一个简单的例子。
import numpy as np
from bokeh.plotting import figure, output_file, show
output_file('bokeh_cycle_colors.html')
p = figure(width=400, height=400)
x = np.linspace(0, 10)
for m in xrange(10):
y = m * x
p.line(x, y, legend='m = {}'.format(m))
p.legend.location='top_left'
show(p)
生成此图的程序
cycle color
的文档中,我得到了四个结果,但页面上实际上没有包含单词cycle
。