仅获取颜色列表并使用
itertools以下命令自己循环,这可能是最简单的:
import numpy as npfrom bokeh.plotting import figure, output_file, show# select a palettefrom bokeh.palettes import Dark2_5 as palette# itertools handles the cyclingimport itertoolsoutput_file('bokeh_cycle_colors.html')p = figure(width=400, height=400)x = np.linspace(0, 10)# create a color iteratorcolors = itertools.cycle(palette)for m, color in zip(range(10), colors): y = m * x p.line(x, y, legend='m = {}'.format(m), color=color)p.legend.location='top_left'show(p)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)