On 3/9/07, Matthieu Brucher <[EMAIL PROTECTED]> wrote:

> What I have is a set of points in a numpy.array - for instance size (2000,
> 2) -. What I have as well is a nump.array of size (2000, 3). How can I make
> plot understand that each line of the set points must be painted with the
> corresponding line in the colour array ?

You'll probably want to use a regular poly collection, as in the
example below.  Your array of facecolors can pretty much be whatever
you want:

from pylab import figure, nx, show, cm
from matplotlib.collections import RegularPolyCollection


fig = figure()
ax = fig.add_subplot(111)

offsets = nx.mlab.rand(20,2)
facecolors = [cm.jet(x) for x in nx.mlab.rand(20)]
black = (0,0,0,1)

collection = RegularPolyCollection(
    fig.dpi,
    numsides=5, # a pentagon
    rotation=0,
    sizes=(50,),
    facecolors = facecolors,
    edgecolors = (black,),
    linewidths = (1,),
    offsets = offsets,
    transOffset = ax.transData,
    )

ax.add_collection(collection)

show()







> Matthieu
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to