Martinho MA wrote: > the script used and data file are at: > http://neptuno.fis.ua.pt/tmp/comp.html
The blocks (quadrilaterals) defined by your data grid are quite a bit smaller than the png-file pixels, so perhaps it is not surprising that matlab and mpl (via Agg) might be using different strategies to decide when to color a pixel in the image. How do you decide which one is a better representation of the data? What sort of downsampling algorithm do you want? (Not that you have a choice, short of writing your own code to generate the image from the data.) You can get closer to the Matlab result by adding to your pcolor call the kwargs antialiased=False, edgecolor='none'. It still looks like Agg is using a rule along the lines of "if there is any part of a patch in this pixel, color it", and maybe Matlab is taking the opposite approach. The Cairo renderer appears to be doing the same thing as Agg, and not to be respecting the antialiased kwarg; but I have not checked this very carefully. Instead of using pcolor, you can get a very similar result *much* faster by using: pylab.pcolormesh(lon, lat, sst, antialiased=False) Eric ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users