|
From: Mathew Y. <mat...@gm...> - 2010-04-07 21:19:38
|
I think this will only work with some projections but not all. I looked at the code for tissot. It's pretty hairy but it almost does what I want. (It draws projected circles instead of projected rectangles. On Wed, Apr 7, 2010 at 1:54 PM, Jeff Whitaker <js...@fa...> wrote: > Yeates, Mathew C (388D) wrote: > > > > > > > > Hi > > > > What is the simplest way to fill in a 1 degree by 1 degree rectangle > > on a basemap projection? > > > > > > > > Mathew > > > > Mathew: Try this (for a 10x10 rectangle, but you get the idea) > > from matplotlib.patches import Polygon > import matplotlib.pyplot as plt > from mpl_toolkits.basemap import Basemap > map = Basemap(projection='moll',lon_0=0) > x1,y1 = map(-10,-10) > x2,y2 = map(-10,10) > x3,y3 = map(10,10) > x4,y4 = map(10,-10) > p = Polygon([(x1,y1),(x2,y2),(x3,y3),(x4,y4)],\ > facecolor='red',edgecolor='blue',linewidth=2) > plt.gca().add_patch(p) > map.drawcoastlines() > map.drawmapboundary() > plt.show() > > -Jeff > > > > > > ------------------------------------------------------------------------------ > 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 > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |