I'd like to make pcolor images using non-'cyl' projections, but I want
the pcolor pixels to be trapezoidal rather than rectangular. Is this
possible?
Mike
Example script"
# example data
lonin = numpy.arange(0.,360.,2.5)
latin = numpy.arange(-90.,92.5,2.5)
field = numpy.ones([len(latin),len(lonin)]) +
10.0*numpy.random.random([len(latin),len(lonin)])
# adapt for plot
#field,lons = addcyclic(field,lonin)
#field,lons = shiftgrid(180.,field,lons,start=False)
# offset for pcolor
field = 0.5*(field[:-1,:-1]+field[1:,1:])
fig = figure()
canvas = FigureCanvas(fig)
the_map = Basemap(resolution='c',projection='lcc',llcrnrlon=-75.,
llcrnrlat=15.,urcrnrlon=40.,urcrnrlat=60.,lat_1=50.,
lon_0=-45.)
# convert to projected coordinates
dx = 2.*pi*the_map.rmajor/len(lons)
nx = int((the_map.xmax-the_map.xmin)/dx)+1
ny = int((the_map.ymax-the_map.ymin)/dx)+1
z,x,y =
the_map.transform_scalar(field,lons,lats,nx,ny,returnxy=True,order=0)
# creates seemingly correct image in term of grid placement, but with
rectangular pixels
the_image = the_map.pcolor(x,y,z,shading='flat')
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users