Hi Eric, Thanks much - I'll try that.
________________________________________ From: Eric Firing [efir...@hawaii.edu] Sent: Friday, June 05, 2009 10:43 AM To: Young, Karl Cc: John Hunter; matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] consistent colors between imshow and scatter Young, Karl wrote: > Thanks for the tip and sorry I didn't include a complete code > snippet; the current code involves images (scipy.ndimage) and > clustering code and I thought that was a little too much too include; > I'll try to extract something simpler. I guess the main question is > how to use a set of integers to index a color space consistently for > both scatter and imshow but I'll try to come up with a simple > example. Thanks agan. > Karl, It sounds like you need to specify the norm=colors.NoNorm() argument. http://matplotlib.sourceforge.net/api/colors_api.html?highlight=nonorm#matplotlib.colors.NoNorm Then if your data are integers (typed as integers, not just taking integer values), they will be interpreted as indices into the color table. You will probably also want to generate that table yourself and specify it via the cmap=my_cmap kwarg. If you have only a few values, then you may want to generate it as a colors.ListedColormap: http://matplotlib.sourceforge.net/api/colors_api.html?highlight=listedcolormap#matplotlib.colors.ListedColormap http://matplotlib.sourceforge.net/examples/api/colorbar_only.html?highlight=listedcolormap It looks like we don't have any good examples sitting around showing the use of NoNorm; but try it anyway. Eric ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users