title: Python+Bokeh : How to color points category wise on a line plot in Bokeh?
body: <p>I am trying to plot a lineplot with Bokeh whih will show points  different colors according to their categories. these points are respiration rates of a patient. There are 13 categories of respiration rates like A, B, C etc. I was able todraw the plot, but unable to put colors on it according to categories. </p>
  
  <p>Here's my code to draw the plot:</p>
  
  <pre><code>x = np.arange(1, len(resp_rates))
  y = resp_rates
  # output to static HTML file
  output_file("Respiration rate.html")
  
  # create a new plot with a title and axis labels
  p = figure(title="Respiration rate class", x_axis_label= "Patient ID 123", y_axis_label= "Respiration rates", plot_width = 1000)
  
  # add a line renderer with legend and line thickness
  p.line(x, y, legend="Respiration rate", line_width=2)
  
  
  # show the results
  show(p)
  </code></pre>
  
  <p>Output:
  <a href="https://i.stack.imgur.com/c4R6G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c4R6G.png" alt="enter image description here"></a></p>
  
  <p>I have calculated the classes of every points which are stored in list called labels. How to color the points on the lineplot according to their classes/labels? <strong>I have to use Bokeh only.</strong></p>
  
  <p><strong>Edit:</strong>
  I changed the code:</p>
  
  <pre><code>x = np.arange(1, len(resp_rates))
  y = resp_rates
  # output to static HTML file
  output_file("Respiration rate.jpg")
  
  # create a new plot with a title and axis labels
  p = figure(title="Respiration rate class", x_axis_label= "Patient ID 123", y_axis_label= "Respiration rates", plot_width = 3000, x_range=(0, 101))
  
  # add a line renderer with legend and line thickness
  pal = Dark2[3]
  factors = list(set(labels))
  source = ColumnDataSource(data=dict(Classes=labels, x=x, y=y))
  p.line(x, y, legend="Respiration rate", line_width=2, factor_cmap('Classes', palette=pal, factors=factors), source=source)
  
  
  # show the results
  show(p)
  </code></pre>
  
  <p>Now it's giving this error:</p>
  
  <pre><code> File "&lt;ipython-input-32-8377d3798bb8&gt;", line 13
      p.line(x, y, legend="Respiration rate", line_width=2, factor_cmap('Classes', palette=pal, factors=factors), source=source)
                                                           ^
  SyntaxError: positional argument follows keyword argument
  </code></pre>