Thanks for the explanation Eric. Now it makes sense. As pcolor does not allow interpolation, my last chance is to use imshow but that creates another issue as it allows only one argument (z) not 3 (x,y,z) as pcolor or contourf and it will display the whole dataset instead of the zoomed area. Is there a way to have it display just a region?
Another way that I could be able to solve my issue is by overlapping the contourf ovet the pcolor graph. Is there a way to do that when I have the commands one after the other, the last one clears the previous? Thanks, Anton efiring wrote: > > antonv wrote: >> Ok. Then what do you think would be the best way to have a smooth graph >> like >> the contourf but with the data shown by pcolor? The best of both worlds >> in >> other words :) >> >> Thanks, >> Anton > > Anton, > > The other thing to bear in mind is that with contourf, you are > specifying the data values at grid points, and the algorithm is > essentially interpolating to calculate the boundaries of polygons for > which the data are between two adjacent contour levels; with pcolor you > are specifying the boundaries of a grid, and your data values determine > the colors of those rectangles (or more generally, quadrilaterals). > That is, with pcolor your data value, Zij, determines the color of the > box with corners at Xij,Yij and Xi+1 j+1, Yi+1 j+1. > > Eric > >> >> >> >> Jeff Whitaker wrote: >>> antonv wrote: >>>> When plotting the same ocean data with contourf or pcolor I noticed a >>>> difference at the edge between ocean area and the land where there is >>>> no >>>> data. Basically, contourf is trimming from the edge and when using >>>> basemap >>>> you can see the underlying fill color. Is this normal behaviour or am I >>>> doing something wrong? >>>> >>>> I've attached 2 images to show exactly what is happening. >>>> >>>> Thanks, >>>> Anton >>>> >>>> >>>> http://www.nabble.com/file/p21397184/img_contourf.png img_contourf.png >>>> http://www.nabble.com/file/p21397184/img_pcolor.png img_pcolor.png >>>> >>> Anton: Contourf and pcolor deal with missing values in masked arrays >>> differently, so yes - I think this is normal behavior. >>> >>> -Jeff >>> >>> ------------------------------------------------------------------------------ >>> Check out the new SourceForge.net Marketplace. >>> It is the best place to buy or sell services for >>> just about anything Open Source. >>> http://p.sf.net/sfu/Xq1LFB >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/Plotting-difference-between-contourf-and-pcolor-tp21397184p21403657.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users