On Mon, May 9, 2011 at 5:11 PM, Pythonified <netdriverem...@gmail.com>wrote:

>
>
> Pythonified wrote:
> >
> > I have been trying to assign different colors for each line I plot, where
> > the colors are incrementally darkened (or lightened), or selected from a
> > colorbar (e.g. rainbow).
> >
> > Any ideas?
> >
>
> I have found a simple and better way. One can chose from colors from a
> color
> map:
>
> >>import pylab as pl
> >>import matplotlib.cm as cm
> >>xval = pl.arange(0, 20, 0.2)
> >>for i in range(256):
>     ...  pl.plot(xval, pl.sin(xval)+i, c=cm.hot(i), lw=5)
>
> This one if, for instance, picking from a color map called "hot". If one
> wants to the colors to fade away, or darken, the "alpha" option can be
> utilized or another color map in which colors darken or fade into another
> color.
>
> There is no need for a long sophisticated script.
>
> Enjoy,
> Pythonified
>

Nice trick. This can go into the gallery or somewhere else in scipy
cookbook.


-- 
Gökhan
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to