From: <js...@us...> - 2010-12-29 19:18:30
|
Revision: 8861 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8861&view=rev Author: jswhit Date: 2010-12-29 19:18:24 +0000 (Wed, 29 Dec 2010) Log Message: ----------- add Hammer Modified Paths: -------------- trunk/toolkits/basemap/examples/test.py Modified: trunk/toolkits/basemap/examples/test.py =================================================================== --- trunk/toolkits/basemap/examples/test.py 2010-12-29 18:51:07 UTC (rev 8860) +++ trunk/toolkits/basemap/examples/test.py 2010-12-29 19:18:24 UTC (rev 8861) @@ -610,6 +610,33 @@ # create new figure fig=plt.figure() +# setup of basemap ('hammer' = Hammer-Aitoff projection) +m = Basemap(projection='hammer', + resolution='c',area_thresh=10000.,lon_0=0.5*(lonsin[0]+lonsin[-1])) +ax = fig.add_axes([0.1,0.1,0.7,0.7]) +# plot image over map with pcolormesh. +x,y = m(*np.meshgrid(lonsin,latsin)) +p = m.pcolormesh(x,y,topodatin,shading='flat') +pos = ax.get_position() +l, b, w, h = pos.bounds +cax = plt.axes([l+w+0.05, b, 0.05, h]) # setup colorbar axes. +plt.colorbar(cax=cax) # draw colorbar +plt.axes(ax) # make the original axes current again +# draw coastlines and political boundaries. +m.drawcoastlines() +# draw parallels and meridians +parallels = np.arange(-60.,90,30.) +m.drawparallels(parallels,labels=[1,0,0,0]) +meridians = np.arange(0.,360.,30.) +m.drawmeridians(meridians) +# draw boundary around map region. +m.drawmapboundary() +plt.title('Hammer') +print 'plotting Hammer example ...' +print m.proj4string + +# create new figure +fig=plt.figure() # setup of basemap ('robin' = robinson projection) m = Basemap(projection='robin', resolution='c',area_thresh=10000.,lon_0=0.5*(lonsin[0]+lonsin[-1])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |