|
From: <js...@us...> - 2008-06-11 12:37:33
|
Revision: 5469
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5469&view=rev
Author: jswhit
Date: 2008-06-11 05:37:21 -0700 (Wed, 11 Jun 2008)
Log Message:
-----------
add material to users guide
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/index.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/ortho_full.png
trunk/toolkits/basemap/doc/users/figures/ortho_full.py
trunk/toolkits/basemap/doc/users/figures/ortho_partial.png
trunk/toolkits/basemap/doc/users/figures/ortho_partial.py
trunk/toolkits/basemap/doc/users/mapsetup.rst
trunk/toolkits/basemap/doc/users/ortho.rst
Added: trunk/toolkits/basemap/doc/users/figures/ortho_full.png
===================================================================
(Binary files differ)
Property changes on: trunk/toolkits/basemap/doc/users/figures/ortho_full.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/doc/users/figures/ortho_full.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/ortho_full.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/ortho_full.py 2008-06-11 12:37:21 UTC (rev 5469)
@@ -0,0 +1,14 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0, lat_0 are the center point of the projection.
+# resolution = 'l' means use low resolution coastlines.
+m = Basemap(projection='ortho',lon_0=-105,lat_0=40,resolution='l')
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,420.,60.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Full Disk Orthographic Projection")
+plt.savefig('ortho_full.png')
Added: trunk/toolkits/basemap/doc/users/figures/ortho_partial.png
===================================================================
(Binary files differ)
Property changes on: trunk/toolkits/basemap/doc/users/figures/ortho_partial.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/doc/users/figures/ortho_partial.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/ortho_partial.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/ortho_partial.py 2008-06-11 12:37:21 UTC (rev 5469)
@@ -0,0 +1,28 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+fig = plt.figure()
+# global ortho map centered on lon_0,lat_0
+lat_0=10.; lon_0=57.
+# resolution = None means don't process the boundary datasets.
+m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None)
+# add an axes with a black background
+ax = fig.add_axes([0.1,0.1,0.8,0.8],axisbg='k')
+# plot just upper right quadrant (corners determined from global map).
+# keywords llcrnrx,llcrnry,urcrnrx,urcrnry used to define the lower
+# left and upper right corners in map projection coordinates.
+# llcrnrlat,llcrnrlon,ucrnrlon,urcrnrlat could be used to define
+# lat/lon values of corners - but this won't work in cases such as this
+# where one of the corners does not lie on the earth.
+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')
+m.drawcountries()
+# draw parallels and meridians.
+m.drawparallels(np.arange(-90.,120.,30.))
+m.drawmeridians(np.arange(0.,360.,60.))
+m.drawmapboundary()
+plt.title('Orthographic Map Showing A Quadrant of the Globe')
+plt.savefig('ortho_partial.png')
Modified: trunk/toolkits/basemap/doc/users/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/index.rst 2008-06-11 12:23:05 UTC (rev 5468)
+++ trunk/toolkits/basemap/doc/users/index.rst 2008-06-11 12:37:21 UTC (rev 5469)
@@ -10,3 +10,4 @@
.. toctree::
intro.rst
+ mapsetup.rst
Added: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-06-11 12:37:21 UTC (rev 5469)
@@ -0,0 +1,31 @@
+.. _mapsetup:
+
+Setting up the map
+==================
+
+In order to represent the curved surface of the earth on a two-dimensional
+map, a map projection is needed. Since this cannot be done without
+distortion, there are many map projections, each with it's own advantages
+and disadvantages. Basemap provides 19 different map projections.
+Some are global, some can only represent a portion of the globe. When
+a Basemap class instance is created, the desired map projection must
+be specified, along with information about the portion of the earth's
+surface that the map projection will describe. There are two basic
+ways of doing this. One is to provide the latitude and longitude values
+of each of the four corners of the rectangular map projection region.
+The other is to provide the lat/lon value of the center of the map
+projection region along with the width and height of the region in
+map projection coordinates.
+
+The class variable ``supported_projections`` is a dictionary containing
+information about all the projections supported by Basemap. The keys
+are the short names (used with the ``projection`` keyword to define
+a projection when creating a ``Basemap`` class instance), and the values
+are longer, more descriptive names. The class variable ``projection_params``
+is a dictionary that provides a list of parameters that can be used to
+define the properties of each projection. Following are examples that
+illustrate how to set up each of the supported projections.
+
+.. toctree::
+
+ ortho.rst
Added: trunk/toolkits/basemap/doc/users/ortho.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/ortho.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/ortho.rst 2008-06-11 12:37:21 UTC (rev 5469)
@@ -0,0 +1,15 @@
+.. _ortho:
+
+Orthographic Projection
+=======================
+
+The orthographic projection displays the earth as a satellite
+(in an orbit infinitely high above the earth) would see it.
+
+.. literalinclude:: figures/ortho_full.py
+
+.. image:: figures/ortho_full.png
+
+.. literalinclude:: figures/ortho_partial.py
+
+.. image:: figures/ortho_partial.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|