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 > example data from my previous post): > > "File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line > 6091, in pcolormesh > C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at > IndexError: too many indices" > > >> using contourf: >> m.contourf(x,y,dat,clevs) >> > > Not tried because contour maps are not exactly what I need. > > >> using imshow: >> m.imshow(dat) >> > > Another error message: > > " File "/usr/lib/python2.5/site-packages/matplotlib/image.py", line > 292, in set_data > raise TypeError("Invalid dimensions for image data") > TypeError: Invalid dimensions for image data" > > (Have I to meshgrid the data first?) >
Mauro: The shape of x, y, and dat must all be (nlats, nlons). > >> There are examples of all three included with basemap. >> > > Indeed, I could not find an example of pcolormesh(). But the > ccsm_popgrid.py example offers a potential solution for another > problem (but this is the second part of my question). > test.py includes pcolormesh examples (the call signature for pcolor is the same though). -Jeff > Best wishes, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users