Revision: 6126 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6126&view=rev Author: jswhit Date: 2008-09-28 00:34:36 +0000 (Sun, 28 Sep 2008)
Log Message: ----------- added robinson and cyl tests Modified Paths: -------------- trunk/toolkits/basemap/examples/warpimage.py Modified: trunk/toolkits/basemap/examples/warpimage.py =================================================================== --- trunk/toolkits/basemap/examples/warpimage.py 2008-09-27 20:33:21 UTC (rev 6125) +++ trunk/toolkits/basemap/examples/warpimage.py 2008-09-28 00:34:36 UTC (rev 6126) @@ -20,9 +20,18 @@ plt.title("Lights at Night image warped from 'cyl' to 'ortho' projection",fontsize=12) print 'warp to orthographic map ...' -# redisplay (same image specified) should be fast since data is cached. -fig = plt.figure() -m.warpimage(image='earth_lights_lrg.jpg') +# create new figure +fig=plt.figure() +# define orthographic projection centered on North America. +m = Basemap(projection='robin',lon_0=-100,resolution='l') +m.bluemarble() +# draw coastlines. +m.drawcoastlines(linewidth=0.5,color='0.5') +# draw lat/lon grid lines every 30 degrees. +m.drawmeridians(np.arange(0,360,60),color='0.5') +m.drawparallels(np.arange(-90,90,30),color='0.5') +plt.title("Blue Marble image warped from 'cyl' to 'robinso' projection",fontsize=12) +print 'warp to robinson map ...' # create new figure fig=plt.figure() @@ -36,10 +45,24 @@ m.drawmeridians(np.arange(-180,180,60),labels=[0,0,0,1],color='0.5') m.drawparallels(np.arange(-90,90,30),labels=[1,0,0,0],color='0.5') plt.title("Blue Marble image - native 'cyl' projection",fontsize=12) -print 'plot cylindrical map (no warping needed) ...' +print 'plot native cylindrical map (no warping needed) ...' # create new figure fig=plt.figure() +# define cylindrical equidistant projection. +m = Basemap(projection='cyl',llcrnrlon=0,llcrnrlat=-60,urcrnrlon=360,urcrnrlat=60,resolution='l') +# plot (unwarped) rgba image. +im = m.bluemarble() +# draw coastlines. +m.drawcoastlines(linewidth=0.5,color='0.5') +# draw lat/lon grid lines. +m.drawmeridians(np.arange(-180,180,60),labels=[0,0,0,1],color='0.5') +m.drawparallels(np.arange(-90,90,30),labels=[1,0,0,0],color='0.5') +plt.title("Blue Marble image - non-native 'cyl' projection",fontsize=12) +print 'plot non-native cylindrical map (warping needed) ...' + +# create new figure +fig=plt.figure() # define orthographic projection centered on Europe. m = Basemap(projection='ortho',lat_0=40,lon_0=40,resolution='l') # plot a gray-scale image specified from a URL. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins