Plot with color argument as a list

Ga?l> Hi, It would be a nice feature for the plot command to
    Ga?l> accept a list of rgb colors of the same length than the data
    Ga?l> vectors to be plotted, in order to generate plots alike the
    Ga?l> one on the wiki
    Ga?l> "http://scipy.org/Cookbook/Matplotlib/MulticoloredLine".

Eric recently updated LineCollection to inherit from ScalarMappable
(in mpl 0.87.3) which means you can pass it a colormap instance.
Perhaps we should update the wiki example to reflect this. I'm not at
all opposed to making a helper function like scatter to plot
parametric lines with colormaps, but I don't think "plot" is the right
vehicle, since it returns a Line2d, not a LineCollection, and since it
is already heavily overloaded. parplot?

JDH

I think having a helper function is a good idea. Not only does it
help the newcomer, but it also allows the oldtimer to write shorter and
more readable code.

    I find that "parplot" is not a great name for such a function, but I
cannot think of a better one. Maybe the list will have better ideas.

    Gaël

···

On Tue, Jun 13, 2006 at 09:21:44AM -0500, John Hunter wrote:

I'm not at all opposed to making a helper function like scatter to plot
parametric lines with colormaps, but I don't think "plot" is the right
vehicle, since it returns a Line2d, not a LineCollection, and since it
is already heavily overloaded. parplot?

Talking to a friend we came up with a name like "pathcolor", or
"pathplot".

  Gaël

···

On Tue, Jun 13, 2006 at 05:33:57PM +0200, Gaël Varoquaux wrote:

    I find that "parplot" is not a great name for such a function, but I
cannot think of a better one. Maybe the list will have better ideas.

How about 'plots'? (i.e., a bunch of plot commands)

Perhaps this could also be the function that loops through multiple lines. For example in matlab you can do

plot (x, y)
plot (x', y')

to plot out a grid -- the columns (or is it the rows..) are looped through inside the plot command. Is this the sort of thing you have in mind for the new 'parplot' command?

-Rob

···

On Jun 14, 2006, at 1:06 AM, Gaël Varoquaux wrote:

On Tue, Jun 13, 2006 at 05:33:57PM +0200, Gaël Varoquaux wrote:

    I find that "parplot" is not a great name for such a function, but I
cannot think of a better one. Maybe the list will have better ideas.

    Talking to a friend we came up with a name like "pathcolor", or
"pathplot".

  Gaël

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
matplotlib-devel List Signup and Options

-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: hetland@...345..., w: http://pong.tamu.edu