Bringing up an old thread, but just curious if this can be done with the plot
command as well, as in:
plt.plot(X,Y[1:3,:].T,c=['blue','red'])

Thanks,
john


sordnay wrote:
> 
> 
> John Hunter-4 wrote:
>> 
>> On Fri, Jun 20, 2008 at 6:14 PM, sordnay <sord...@gmail.com> wrote:
>>>
>>> Hi all,
>>> I'm trying to plot in 2D, 3 variables from time series, instead of
>>> volume I
>>> want color for the third variable.
>>> I have partial success with a scatter plot, but I'm unable to manage the
>>> colorbar so it represents z values,
>>> I needed to sort the variables and it's getting a bit ugly, so I though
>>> I
>>> might be missing some other function ?
>>> this is what I used:
>>>            pylab.figure()
>>>            x=self.stData.[items[0]]
>>>            y=self.stData.[items[1]]
>>>            z=self.stData.[items[2]]
>>>            points=zip(x,y)
>>>            points3=sorted(zip(z,points))
>>>            for i,p in enumerate(points3):
>>>                z[i]=p[0]
>>>                x[i]=p[1][0]
>>>                y[i]=p[1][1]
>>>            #colors=pylab.linspace(z.min(),z.max(),len(z)) did not work
>>>            colors=pylab.linspace(0,1,len(z))
>>>            pylab.scatter(x,y,c=colors,faceted=False)
>> 
>> Just pass c=z to scatter if z are the values you want to colormap.
>> 
>> JDH
>> 
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
> 
> yes it was lot easier, but i had to set the vmin and vmax kwargs or it
> wouldn't work:
>             sigbrowse=figure()
>             x=self.stData.Data[items[0]]
>             y=self.stData.Data[items[1]]
>             z=self.stData.Data[items[2]]
>             scatter(x,y,c=z,faceted=False,vmin=z.min(),vmax=z.max())
>             colorbar()
>             show()
> 
> 

-- 
View this message in context: 
http://old.nabble.com/color-xy-plot-tp18047665p30061906.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to