When plotting with Bokeh, how do you automatically cycle through a color pallette?
<p>I want to use a loop to load and/or modify data and plot the result within the loop using Bokeh (I am familiar with <a href="http://matplotlib.org/1.2.1/examples/api/color_cycle.html" rel="noreferrer">Matplotlib's <code>axes.color_cycle</code></a>).  Here is a simple example</p>

<pre><code>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)
</code></pre>

<p>which generates this plot</p>

<p><img src="https://i.stack.imgur.com/9OtK9.png" alt="bokeh plot"></p>

<p>How do I make it so the colors cycle without coding up a list of colors and a modulus operation to repeat when the number of colors runs out?  </p>

<p>There was some discussion on GitHub related to this, issues <a href="https://github.com/bokeh/bokeh/issues/351" rel="noreferrer">351</a> and <a href="https://github.com/bokeh/bokeh/issues/2201" rel="noreferrer">2201</a>, but it is not clear how to make this work.  The four hits I got when searching the <a href="http://bokeh.pydata.org/en/latest/search.html?q=cycle+colors" rel="noreferrer">documentation</a> for <code>cycle color</code> did not actually contain the word <code>cycle</code> anywhere on the page.</p>