Plotting non-rectangular data on maps

Orion Poplawski wrote:

Jeff Whitaker wrote:

Orion Poplawski wrote:

I've got a 2-D array of values that I'd like to plot onto a map with Basemap. The latitude and longitudes for each point are stored in their own 2-D array that matches that of the values. Can some one help with how to do this? Looks like basemap requires a square and uniform set of data to plot?

Orion: There's an example of this in the examples directory called ''. Have a look at that, and if you have questions let us know.

Actually, it looks like I may have been making things harder than I thought they would be. Is there any reason to believe that this isn't doing what it seems like it should? seems much more complicated, and I'm don't really understand it yet.

tpxyzo has data for 12 different altitudes, and I'm selecting one. It appears the x,y=m(lon,lat) is unneeded for cylindrical projections, but I've left it in here as a general case.

from matplotlib.toolkits.basemap import Basemap
from pylab import *



x, y = m(lon,lat)

The output is the attached image, which as you can see does not have a rectangular shape.


Orion: If the image were rectangular on a cylindrical projection, then you wouldn't need 2d arrays to describe the lats and lons of the grid. Are you sure the image should be rectangular? What kind of a grid is it?



Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web :