I was wondering this about 2 years ago [http://old.nabble.com/Gradient-color-on-a-line-object-td25630375.html]
Just today, I have found a very simple way to do this in mpl.
x = np.linspace(0, 2*np.pi, 3600)
y = np.sin(x)
plt.scatter(x,y,c=range(len(x)), marker=’_’, s=1)
Setting the marker to underscore character and choosing a relatively low size value makes the line appear just like I wanted. (Provided, using lengthy data points)
Is this a very known trick? If not so, what is your favorite color gradient approach for a simple plot?