Howdy All,
I'm hoping someone can give me a quick solution to a couple of
problems. I think I'm just missing an idea or two.
Problem 1: I'm creating a map using the 'llc' lambert conformal
projection and pcolormesh. Here is a sampling of the source.
self.m = Basemap(lat_0=self.lat_0,lon_0=self.lon_0,projection='lcc',
width=store_comp.base_width,height=store_comp.base_height,
resolution='i',area_thresh=100000)
self.fig = plt.figure(figsize=(width,hieght),frameon=True)
self.ax = self.fig.add_subplot(111)
self.xx, self.yy = self.m(*numpy.meshgrid(self.x,self.y))
self.the_image =
self.m.pcolormesh(self.xx,self.yy,z,edgecolors='None',cmap=self.color_scheme)
The problem I have is two fold: 1) the map segment isn't
fully shown unless I drive up the width and size in basemap so that
the map floats in a lot of whitespace. 2) when I use drawparallels
etc. the lines extend beyond the map in a way that I wish they
wouldn't. See map1 in http://gallery.me.com/ohtinsel#100149
Problem 2: This problem comes up when I use contourf on the same
data, which occupies only a limited domain (i.e., there is no data
outside the lat/lon bounds shown in map1). Here the contours spill out
onto the plot in a way that I wish they wound't (some of the source
is below). See map2 in http://gallery.me.com/ohtinsel#100149
self.x = numpy.where(self.x < 180.0,self.x,self.x-360.0)
scale = 1
dx = self.width/((len(self.x)-1)*scale)
dy = self.height/((len(self.y)-1)*scale)
nx = int((self.m.xmax-self.m.xmin)/dx)+1
ny = int((self.m.ymax-self.m.ymin)/dy)+1
self.z,self.xx,self.yy = self.m.transform_scalar(
self.z,self.x,self.y,nx,ny,returnxy=True)
self.the_image =
self.m.contour(self.xx,self.yy,self.z,colors='k')
self.the_image = self.m.contourf(self.xx,self.yy,self.z,
cmap=self.color_scheme,extend=self.extend)
No doubt I'm doing something wrong and probably obvious, but I can't
figure it out. Suggestions are much appreciated.
Mike
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users