If I understand correctly, the function:
matplotlib.pyplot.plot(x, y)
plots len(x)-1 separate line segments - one going from (x[0], y[0]) to (x
You should be able to use matplotlib.collections.LineCollection which accepts a colors parameter (sequence of RGBA tuples).
colors