Dear Jeff,
2008/12/9 Jeff Whitaker [EMAIL PROTECTED]:
Assuming that this is a regular grid (so that using meshgrid makes sense)
you can
using pcolor:
m.pcolormesh(x,y,dat)
Unfortunately, this didn't work. I got the error message (using the
example data from my previous post):
File
Mauro Cavalcanti wrote:
Dear ALL,
Good morning! Here am I again with the first (and perhaps simpler)
part of a potentially long question on plotting gridded data using MPL
(*and* Basemap).
Most examples I have found of plotting gridded data (using either
MATLAB or MPL) depict highly
Mauro Cavalcanti wrote:
Dear Jeff,
2008/12/9 Jeff Whitaker [EMAIL PROTECTED]:
Assuming that this is a regular grid (so that using meshgrid makes sense)
you can
using pcolor:
m.pcolormesh(x,y,dat)
Unfortunately, this didn't work. I got the error message (using the
Mauro Cavalcanti wrote:
Dear Jeff,
2008/12/9 Jeff Whitaker [EMAIL PROTECTED]:
Mauro: The shape of x, y, and dat must all be (nlats, nlons).
I tried to do:
coords = numpy.loadtxt('grid.dat')
lon = coords[:,0]
lat = coords[:,1]
dat = coords[:,2]
X, Y = numpy.meshgrid(lon, lat)
Mauro Cavalcanti wrote:
I tried to do:
coords = numpy.loadtxt('grid.dat')
lon = coords[:,0]
lat = coords[:,1]
dat = coords[:,2]
X, Y = numpy.meshgrid(lon, lat)
nlons = X.shape[1]
nlats = X.shape[0]
Z = dat.reshape(nlats,nlons)
(so that I could proceed to plotting with the X,Y,Z
Dear Scott Jeff,
Sorry for the delay in replying, I was off office for a while.
2008/12/9 Scott Sinclair [EMAIL PROTECTED]:
As Jeff noted earlier, the number of elements in an array can't be
increased simply by reshaping it, so the error message isn't too
mysterious, if carefully