On 2014/11/20, 7:11 PM, Maria Liukis wrote: > Hello, > > I have a problem plotting data which is defined on a grid other than > rectangular mesh, and would greatly appreciate any advise. My data is > defined for 0.1degree grid for the state of California, and I don’t > want to interpolate my data outside of the defined grid when plotting > it. I used pcolormesh() function for rectangular area maps, but it > only accepts rectangular grid and I was wondering if there is a > simple solution to my problem.
Masha, When you say your data "is defined for a 0.1 degree grid", that makes it sound like it is on a quadrilateral grid, so there should be no problem with using pcolormesh. Is it on 0.1 degree lon by 0.1 degree lat points, but only for points within California? Then you can make a masked array with this grid for a rectangle in which the points outside California are masked, and the ones inside are set to your data values. Your X and Y inputs to pcolormesh should be 2-D arrays with the boundary values rather than the centers. It sounds like you would want to do all this via mpl_toolkits.basemap.Basemap so that you will end up with a properly proportioned and labeled map. Maybe I am misinterpreting your description of your data, however. Eric > > The only solution I could find was to use > scipy.interpolate,griddata() to “map” my grid to a bounding > rectangular grid (bounding rectangle around CA state), but that would > also interpolate my data to grid cells outside of CA state, which I > don’t want to do. > > Many thanks for any hints! Masha -- [email protected] > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users