Hi,

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?

Cheers,

-- 
Gökhan
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to