Johann Cohen-Tanugi wrote: > thanks Eric! Could you provide me with an executive summary as to > pcolorfast vs imshow? Is it essentially a matter of speed?
It is more generality than speed. imshow is for genuine image data: an array of pixel values, with the assumption that the pixels are square. imshow supports interpolation. pcolorfast works for any rectilinear grid, and depending on the characteristics of that grid, it uses the same underlying code as imshow, or a slightly slower but more general code for irregular rectangular grids (NonUniformImage), or the considerably slower quadmesh code if the grid is not rectangular. Detection of the kind of grid, and therefore the algorithm to use, is based mainly on the presence and dimensionality of the X and Y input arrays. pcolorfast does not support interpolation; it always displays quadrilaterals of uniform color. pcolorfast differs from pcolor and pcolormesh in that it does not support drawing grid boundaries, it is much faster with *agg backends, and there are some differences in the way input arguments are handled. Also, there is as yet no pyplot interface to it; I thought that some api changes might still be in order, and do not want to put pcolorfast into pyplot until its api is stable. > Also, I tried to add a colorbar but failed. What is the correct invocation? Here is one way: import numpy as np x, y = np.random.randn(2, 100000) H, xedges, yedges = np.histogram2d(x, y, bins=50) fig = figure() ax = fig.add_subplot(111) im = ax.pcolorfast(xedges, yedges, H) cb = fig.colorbar(im) draw() Eric ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users