On 06/05/2010 04:41 PM, per freem wrote: > Hi all, > > How can I plot a matrix of values as a heatmap where values are shown > from green to red intensities, or blue to yellow intensities, like in > the following figure? > > http://www.coriell.org/images/microarray.gif > > I want to have the option of doing this with either green-red maps or > blue-yellow maps. Is the right function for this imshow, or pcolor?
pcolor is general but slow, and best suited for moderate numbers of points. pcolormesh is faster. imshow can be good if you have a uniform Cartesian grid. imshow(...., interpolation='nearest') is the closest analogy to pcolor and pcolormesh. > Also, how can I get the scale bar to the left of it that shows the > ranges of the intensities, and how can this scale be adjusted? In the gallery, and in the corresponding examples subdirectory of the mpl distribution, search for "colorbar". Note that the color scale is not set via colorbar options, but via vmin and vmax kwargs in imshow etc., or via the pylab clim command, or via the set_clim method of the image object returned by imshow. In other words, the colorbar is used for showing a color scale used by another image-like plot element--it is not used for controlling that scale, or any other aspect of the image itself. Eric > > Thanks very much. > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users