code: def color_lines(ax, labels, colors):
      
      assert len(labels) == len(colors), \
          "Equal no. of colors and lables must be given"
      lines = ax.findobj(mpl.lines.Line2D)
      line_labels = [i + "_line" for i in lineid_plot.unique_labels(labels)]
      for line in lines:
          l = line.get_label()
          try:
              loc = line_labels.index(l)
          except ValueError:
              continue  # No changes for this line
          line.set_color(colors[loc])
  
      ax.figure.canvas.draw()
docs: Color lines.
  
      Instead of this function, one can pass annotate_kwargs and plot_kwargs to
      plot_line_ids function.