On Mon, May 4, 2009 at 2:22 AM, Erik Tollerud <erik.tolle...@gmail.com>wrote:

> I'm hoping to generate a line plot where the color of each pixel on
> the plot is given by linearly interpolating the colormap from each
> point specified in the line, instead of having the whole line be a
> solid color.  I can "mock this up" by doing a scatter plot where the
> points are much closer together than the screen resolution, but that
> seems inelegant, and sometimes produces weird output.  So is there a
> way to do effectively the same thing with a line plot or somehow
> specify this behavior in scatter?


IIRC, the backends that matplotlib uses (Gtk, Agg, etc.) only support a
single color per line, so breaking up the line into different
segments/points is really your only option.  Instead of scatter, you can
break up your line into separate sections and have them colormapped for you,
using a LineCollection.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to