Ah, I see... well, that's doable although not necessarily ideal.
Thanks to you both!
On Mon, May 4, 2009 at 10:24 AM, Ryan May <rm...@gm...> wrote:
> On Mon, May 4, 2009 at 2:22 AM, Erik Tollerud <eri...@gm...>
> 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
--
Erik Tollerud
Graduate Student
Center For Cosmology
Department of Physics and Astronomy
2142 Frederick Reines Hall
University of California, Irvine
Office Phone: (949)824-2587
Cell: (651)307-9409
eto...@uc...
|