SourceForge logo
SourceForge logo
Menu

matplotlib-checkins

Revision: 4898
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4898&view=rev
Author: jswhit
Date: 2008年01月26日 05:09:36 -0800 (2008年1月26日)
Log Message:
-----------
illustrate specifying x,y corners for geos and ortho
Added Paths:
-----------
 trunk/toolkits/basemap/examples/geos_demo_3.py
Added: trunk/toolkits/basemap/examples/geos_demo_3.py
===================================================================
--- trunk/toolkits/basemap/examples/geos_demo_3.py	 (rev 0)
+++ trunk/toolkits/basemap/examples/geos_demo_3.py	2008年01月26日 13:09:36 UTC (rev 4898)
@@ -0,0 +1,38 @@
+from mpl_toolkits.basemap import Basemap
+from pylab import title, show, arange, figure
+
+# map with continents drawn and filled.
+fig = figure()
+lon_0=57
+m1 = Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution=None)
+ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
+# plot just upper right quadrant.
+m = Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution='l',llcrnrx=m1.urcrnrx/2.,llcrnry=m1.urcrnry/2.,urcrnrx=m1.urcrnrx,urcrnry=m1.urcrnry)
+print m.projparams
+m.drawcoastlines()
+m.drawmapboundary(fill_color='aqua')
+m.fillcontinents(color='coral',lake_color='aqua')
+m.drawcountries()
+# draw parallels and meridians.
+m.drawparallels(arange(-90.,120.,30.))
+m.drawmeridians(arange(0.,420.,60.))
+m.drawmapboundary()
+title('Geostationary Map Centered on Lon=%s' % lon_0)
+
+fig = figure()
+m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=10,resolution=None)
+ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
+# plot just upper right quadrant.
+m = Basemap(projection='ortho',lon_0=lon_0,lat_0=10,resolution='l',llcrnrx=m1.urcrnrx/2.,llcrnry=m1.urcrnry/2.,urcrnrx=m1.urcrnrx,urcrnry=m1.urcrnry)
+print m.projparams
+m.drawcoastlines()
+m.drawmapboundary(fill_color='aqua')
+m.fillcontinents(color='coral',lake_color='aqua')
+m.drawcountries()
+# draw parallels and meridians.
+m.drawparallels(arange(-90.,120.,30.))
+m.drawmeridians(arange(0.,420.,60.))
+m.drawmapboundary()
+title('Orthographic Map Centered on Lon=%s' % lon_0)
+
+show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 4900
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4900&view=rev
Author: jswhit
Date: 2008年01月26日 05:22:33 -0800 (2008年1月26日)
Log Message:
-----------
add some comments
Modified Paths:
--------------
 trunk/toolkits/basemap/examples/geos_demo_3.py
Modified: trunk/toolkits/basemap/examples/geos_demo_3.py
===================================================================
--- trunk/toolkits/basemap/examples/geos_demo_3.py	2008年01月26日 13:17:19 UTC (rev 4899)
+++ trunk/toolkits/basemap/examples/geos_demo_3.py	2008年01月26日 13:22:33 UTC (rev 4900)
@@ -1,14 +1,13 @@
 from mpl_toolkits.basemap import Basemap
 from pylab import title, show, arange, figure
 
-# map with continents drawn and filled.
 fig = figure()
 lon_0=57
+# global geos map
 m1 = Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution=None)
 ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
-# plot just upper right quadrant.
+# plot just upper right quadrant (coordinates determined from global map).
 m = Basemap(projection='geos',lon_0=lon_0,rsphere=(6378137.00,6356752.3142),resolution='l',llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)
-print m.projparams
 m.drawcoastlines()
 m.drawmapboundary(fill_color='aqua')
 m.fillcontinents(color='coral',lake_color='aqua')
@@ -20,11 +19,12 @@
 title('Geostationary Map Centered on Lon=%s' % lon_0)
 
 fig = figure()
-m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=10,resolution=None)
+# global ortho map
+lat_0=10.
+m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None)
 ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
-# plot just upper right quadrant.
-m = Basemap(projection='ortho',lon_0=lon_0,lat_0=10,resolution='l',llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)
-print m.projparams
+# plot just upper right quadrant (corners determined from global map).
+m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution='l',llcrnrx=0.,llcrnry=0.,urcrnrx=m1.urcrnrx/2.,urcrnry=m1.urcrnry/2.)
 m.drawcoastlines()
 m.drawmapboundary(fill_color='aqua')
 m.fillcontinents(color='coral',lake_color='aqua')
@@ -33,6 +33,6 @@
 m.drawparallels(arange(-90.,120.,30.))
 m.drawmeridians(arange(0.,420.,60.))
 m.drawmapboundary()
-title('Orthographic Map Centered on Lon=%s' % lon_0)
+title('Orthographic Map Centered on Lon=%s, Lat=%s' % (lon_0,lat_0))
 
 show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /