John Hunter-4 wrote: > > On Fri, Jun 20, 2008 at 6:14 PM, sordnay <[EMAIL PROTECTED]> 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://www.nabble.com/color-xy-plot-tp18047665p18161452.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------- 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