SF.net SVN: matplotlib: [5755] trunk/toolkits/basemap/doc/users/figures
Revision: 5755
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5755&view=rev
Author: jswhit
Date: 2008-07-13 05:31:46 -0700 (Sun, 13 Jul 2008)
Log Message:
---
added new example scripts.
Added Paths:
---
trunk/toolkits/basemap/doc/users/figures/aea.py
trunk/toolkits/basemap/doc/users/figures/eqdc.py
trunk/toolkits/basemap/doc/users/figures/geos_full.py
trunk/toolkits/basemap/doc/users/figures/geos_partial.py
trunk/toolkits/basemap/doc/users/figures/laea.py
trunk/toolkits/basemap/doc/users/figures/lcc.py
trunk/toolkits/basemap/doc/users/figures/poly.py
trunk/toolkits/basemap/doc/users/figures/stere.py
Added: trunk/toolkits/basemap/doc/users/figures/aea.py
===
--- trunk/toolkits/basemap/doc/users/figures/aea.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 12:31:46 UTC
(rev 5755)
@@ -0,0 +1,18 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup albers equal area conic basemap
+# lat_1 is first standard parallel.
+# lat_2 is second standard parallel.
+# lon_0,lat_0 is central point.
+m = Basemap(width=1200,height=900,
+resolution='l',projection='aea',\
+lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-80.,81.,20.))
+m.drawmeridians(np.arange(-180.,181.,20.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Albers Equal Area Projection")
+plt.savefig('aea.png')
Added: trunk/toolkits/basemap/doc/users/figures/eqdc.py
===
--- trunk/toolkits/basemap/doc/users/figures/eqdc.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/eqdc.py2008-07-13 12:31:46 UTC
(rev 5755)
@@ -0,0 +1,19 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup equidistant conic basemap.
+# lat_1 is first standard parallel.
+# lat_2 is second standard parallel.
+# lon_0,lat_0 is central point.
+# resolution = 'l' for low-resolution coastlines.
+m = Basemap(width=1200,height=900,
+resolution='l',projection='eqdc',\
+lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+m.drawcoastlines()
+m.fillcontinents(color='coral',lake_color='aqua')
+# draw parallels and meridians.
+m.drawparallels(np.arange(-80.,81.,20.))
+m.drawmeridians(np.arange(-180.,181.,20.))
+m.drawmapboundary(fill_color='aqua')
+plt.title("Equidistant Conic Projection")
+plt.savefig('eqdc.png')
Added: trunk/toolkits/basemap/doc/users/figures/geos_full.py
===
--- trunk/toolkits/basemap/doc/users/figures/geos_full.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/geos_full.py 2008-07-13
12:31:46 UTC (rev 5755)
@@ -0,0 +1,14 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# lon_0 is the central longitude of the projection.
+# resolution = 'l' means use low resolution coastlines.
+m = Basemap(projection='geos',lon_0=-105,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 Geostationary Projection")
+plt.savefig('geos_full.png')
Added: trunk/toolkits/basemap/doc/users/figures/geos_partial.py
===
--- trunk/toolkits/basemap/doc/users/figures/geos_partial.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/geos_partial.py2008-07-13
12:31:46 UTC (rev 5755)
@@ -0,0 +1,28 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+fig = plt.figure()
+# global geostationary map centered on lon_0
+lon_0=57.
+# resolution = None means don't process the boundary datasets.
+m1 = Basemap(projection='geos',lon_0=lon_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='geos',lon_0=lon_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
SF.net SVN: matplotlib: [5756] trunk/toolkits/basemap/doc/users/figures/ omerc.py
Revision: 5756 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5756&view=rev Author: jswhit Date: 2008-07-13 05:31:53 -0700 (Sun, 13 Jul 2008) Log Message: --- update Modified Paths: -- trunk/toolkits/basemap/doc/users/figures/omerc.py Modified: trunk/toolkits/basemap/doc/users/figures/omerc.py === --- trunk/toolkits/basemap/doc/users/figures/omerc.py 2008-07-13 12:31:46 UTC (rev 5755) +++ trunk/toolkits/basemap/doc/users/figures/omerc.py 2008-07-13 12:31:53 UTC (rev 5756) @@ -9,6 +9,8 @@ # the projection centerline. # Map projection coordinates are automatically rotated to true north. # To avoid this, set no_rot=True. +# area_thresh=1000 means don't plot coastline features less +# than 1000 km^2 in area. m = Basemap(height=1670,width=1200, resolution='l',area_thresh=1000.,projection='omerc',\ lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5757] trunk/toolkits/basemap/doc/users/figures
Revision: 5757
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5757&view=rev
Author: jswhit
Date: 2008-07-13 05:59:45 -0700 (Sun, 13 Jul 2008)
Log Message:
---
add tissot's indicatrix to examples to indicate distortion.
Modified Paths:
--
trunk/toolkits/basemap/doc/users/figures/aea.py
trunk/toolkits/basemap/doc/users/figures/eqdc.py
trunk/toolkits/basemap/doc/users/figures/laea.py
trunk/toolkits/basemap/doc/users/figures/lcc.py
trunk/toolkits/basemap/doc/users/figures/stere.py
Modified: trunk/toolkits/basemap/doc/users/figures/aea.py
===
--- trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 12:31:53 UTC
(rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 12:59:45 UTC
(rev 5757)
@@ -1,18 +1,28 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
# setup albers equal area conic basemap
# lat_1 is first standard parallel.
# lat_2 is second standard parallel.
# lon_0,lat_0 is central point.
-m = Basemap(width=1200,height=900,
+m = Basemap(width=800,height=600,
resolution='l',projection='aea',\
-lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
+lat_1=40.,lat_2=60,lon_0=35,lat_0=50)
m.drawcoastlines()
+m.drawcountries()
m.fillcontinents(color='coral',lake_color='aqua')
# draw parallels and meridians.
m.drawparallels(np.arange(-80.,81.,20.))
m.drawmeridians(np.arange(-180.,181.,20.))
m.drawmapboundary(fill_color='aqua')
+# draw tissot's indicatrix to show distortion.
+ax = plt.gca()
+for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
+for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
+lon, lat = m(x,y,inverse=True)
+seg = m.tissot(lon,lat,1.,100)
+poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
+ax.add_patch(poly)
plt.title("Albers Equal Area Projection")
plt.savefig('aea.png')
Modified: trunk/toolkits/basemap/doc/users/figures/eqdc.py
===
--- trunk/toolkits/basemap/doc/users/figures/eqdc.py2008-07-13 12:31:53 UTC
(rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/eqdc.py2008-07-13 12:59:45 UTC
(rev 5757)
@@ -1,6 +1,7 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
# setup equidistant conic basemap.
# lat_1 is first standard parallel.
# lat_2 is second standard parallel.
@@ -15,5 +16,12 @@
m.drawparallels(np.arange(-80.,81.,20.))
m.drawmeridians(np.arange(-180.,181.,20.))
m.drawmapboundary(fill_color='aqua')
+ax = plt.gca()
+for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
+for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
+lon, lat = m(x,y,inverse=True)
+seg = m.tissot(lon,lat,1.5,100)
+poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
+ax.add_patch(poly)
plt.title("Equidistant Conic Projection")
plt.savefig('eqdc.png')
Modified: trunk/toolkits/basemap/doc/users/figures/laea.py
===
--- trunk/toolkits/basemap/doc/users/figures/laea.py2008-07-13 12:31:53 UTC
(rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/laea.py2008-07-13 12:59:45 UTC
(rev 5757)
@@ -1,6 +1,7 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
# setup lambert azimuthal equal area basemap.
# lat_ts is latitude of true scale.
# lon_0,lat_0 is central point.
@@ -13,5 +14,13 @@
m.drawparallels(np.arange(-80.,81.,20.))
m.drawmeridians(np.arange(-180.,181.,20.))
m.drawmapboundary(fill_color='aqua')
+# draw tissot's indicatrix to show distortion.
+ax = plt.gca()
+for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
+for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
+lon, lat = m(x,y,inverse=True)
+seg = m.tissot(lon,lat,1.5,100)
+poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
+ax.add_patch(poly)
plt.title("Lambert Azimuthal Equal Area Projection")
plt.savefig('laea.png')
Modified: trunk/toolkits/basemap/doc/users/figures/lcc.py
===
--- trunk/toolkits/basemap/doc/users/figures/lcc.py 2008-07-13 12:31:53 UTC
(rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/lcc.py 2008-07-13 12:59:45 UTC
(rev 5757)
@@ -1,6 +1,7 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
# setup lambert conformal basemap.
# lat_1 is first standard parallel.
# lat_2 is second standard parallel (defaults to lat_1).
@@ -18,5 +19,13 @@
m.drawparallels(np.arange(-80.,81.,20.))
m.drawmeridians(np.arange(-180.,181.,20.))
m.drawmapboundary
SF.net SVN: matplotlib: [5758] trunk/toolkits/basemap/doc/users/figures/ geos_full.py
Revision: 5758 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5758&view=rev Author: jswhit Date: 2008-07-13 06:03:48 -0700 (Sun, 13 Jul 2008) Log Message: --- update Modified Paths: -- trunk/toolkits/basemap/doc/users/figures/geos_full.py Modified: trunk/toolkits/basemap/doc/users/figures/geos_full.py === --- trunk/toolkits/basemap/doc/users/figures/geos_full.py 2008-07-13 12:59:45 UTC (rev 5757) +++ trunk/toolkits/basemap/doc/users/figures/geos_full.py 2008-07-13 13:03:48 UTC (rev 5758) @@ -3,6 +3,8 @@ import matplotlib.pyplot as plt # lon_0 is the central longitude of the projection. # resolution = 'l' means use low resolution coastlines. +# optional parameter 'satellite_height' may be used to +# specify height of orbit above earth (default 35,786 km). m = Basemap(projection='geos',lon_0=-105,resolution='l') m.drawcoastlines() m.fillcontinents(color='coral',lake_color='aqua') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5759] trunk/toolkits/basemap/doc/users/figures/ poly.py
Revision: 5759 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5759&view=rev Author: jswhit Date: 2008-07-13 06:18:16 -0700 (Sun, 13 Jul 2008) Log Message: --- update Modified Paths: -- trunk/toolkits/basemap/doc/users/figures/poly.py Modified: trunk/toolkits/basemap/doc/users/figures/poly.py === --- trunk/toolkits/basemap/doc/users/figures/poly.py2008-07-13 13:03:48 UTC (rev 5758) +++ trunk/toolkits/basemap/doc/users/figures/poly.py2008-07-13 13:18:16 UTC (rev 5759) @@ -1,12 +1,12 @@ from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt -# setup lccconic basemap +# setup polyconic basemap # by specifying lat/lon corners and central point. # area_thresh=1000 means don't plot coastline features less # than 1000 km^2 in area. m = Basemap(llcrnrlon=-35.,llcrnrlat=-30,urcrnrlon=80.,urcrnrlat=50.,\ -resolution='l',area_thresh=1000.,projection='lcc',\ +resolution='l',area_thresh=1000.,projection='poly',\ lat_0=0.,lon_0=20.) m.drawcoastlines() m.fillcontinents(color='coral',lake_color='aqua') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5760] trunk/toolkits/basemap/doc/users
Revision: 5760 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5760&view=rev Author: jswhit Date: 2008-07-13 06:23:15 -0700 (Sun, 13 Jul 2008) Log Message: --- add new examples. Modified Paths: -- trunk/toolkits/basemap/doc/users/mapsetup.rst Added Paths: --- trunk/toolkits/basemap/doc/users/aea.rst trunk/toolkits/basemap/doc/users/eqdc.rst trunk/toolkits/basemap/doc/users/geos.rst trunk/toolkits/basemap/doc/users/laea.rst trunk/toolkits/basemap/doc/users/lcc.rst trunk/toolkits/basemap/doc/users/poly.rst trunk/toolkits/basemap/doc/users/stere.rst Added: trunk/toolkits/basemap/doc/users/aea.rst === --- trunk/toolkits/basemap/doc/users/aea.rst(rev 0) +++ trunk/toolkits/basemap/doc/users/aea.rst2008-07-13 13:23:15 UTC (rev 5760) @@ -0,0 +1,17 @@ +.. _aea: + +Albers Equal Area Projection + + +An equal-area projection. The green shapes drawn on the map are equal-area +circles on the surface of the earth. Known as "Tissot's indicatrix", +they can be used to show the angular and areal distortion of a map projection. +On a conformal projection, the shape of the circles is preserved, but the +area is not. On a equal-area projection, the area is preserved but the +shape is not. + +Distortion is very large near the poles in this projection. + +.. literalinclude:: figures/aea.py + +.. image:: figures/aea.png Added: trunk/toolkits/basemap/doc/users/eqdc.rst === --- trunk/toolkits/basemap/doc/users/eqdc.rst (rev 0) +++ trunk/toolkits/basemap/doc/users/eqdc.rst 2008-07-13 13:23:15 UTC (rev 5760) @@ -0,0 +1,16 @@ +.. _eqdc: + +Equidistant Conic Projection + + +Neither conformal or equal area. Parallels are equally spaced. +The green shapes drawn on the map are equal-area +circles on the surface of the earth. Known as "Tissot's indicatrix", +they can be used to show the angular and areal distortion of a map projection. +On a conformal projection, the shape of the circles is preserved, but the +area is not. On a equal-area projection, the area is preserved but the +shape is not. + +.. literalinclude:: figures/eqdc.py + +.. image:: figures/eqdc.png Added: trunk/toolkits/basemap/doc/users/geos.rst === --- trunk/toolkits/basemap/doc/users/geos.rst (rev 0) +++ trunk/toolkits/basemap/doc/users/geos.rst 2008-07-13 13:23:15 UTC (rev 5760) @@ -0,0 +1,15 @@ +.. _geos: + +Geostationary Projection + + +The geostationary projection displays the earth as a satellite +(in geostationary orbit) would see it. + +.. literalinclude:: figures/geos_full.py + +.. image:: figures/geos_full.png + +.. literalinclude:: figures/geos_partial.py + +.. image:: figures/geos_partial.png Added: trunk/toolkits/basemap/doc/users/laea.rst === --- trunk/toolkits/basemap/doc/users/laea.rst (rev 0) +++ trunk/toolkits/basemap/doc/users/laea.rst 2008-07-13 13:23:15 UTC (rev 5760) @@ -0,0 +1,15 @@ +.. _laea: + +Lambert Azimuthal Equal Area Projection +=== + +An equal-area projection. The green shapes drawn on the map are equal-area +circles on the surface of the earth. Known as "Tissot's indicatrix", +they can be used to show the angular and areal distortion of a map projection. +On a conformal projection, the shape of the circles is preserved, but the +area is not. On a equal-area projection, the area is preserved but the +shape is not. + +.. literalinclude:: figures/laea.py + +.. image:: figures/laea.png Added: trunk/toolkits/basemap/doc/users/lcc.rst === --- trunk/toolkits/basemap/doc/users/lcc.rst(rev 0) +++ trunk/toolkits/basemap/doc/users/lcc.rst2008-07-13 13:23:15 UTC (rev 5760) @@ -0,0 +1,15 @@ +.. _lcc: + +Lambert Conformal Projection + + +A conformal projection. The green shapes drawn on the map are equal-area +circles on the surface of the earth. Known as "Tissot's indicatrix", +they can be used to show the angular and areal distortion of a map projection. +On a conformal projection, the shape of the circles is preserved, but the +area is not. On a equal-area projection, the area is preserved but the +shape is not. + +.. literalinclude:: figures/lcc.py + +.. image:: figures/lcc.png Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst === --- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-13 13:18:16 UTC (rev 5759) +++ trunk/toolkits/basemap/doc/users/mapsetup.rst
SF.net SVN: matplotlib: [5761] trunk/toolkits/basemap/examples/plot_tissot. py
Revision: 5761 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5761&view=rev Author: jswhit Date: 2008-07-13 06:24:30 -0700 (Sun, 13 Jul 2008) Log Message: --- make polygons transparent Modified Paths: -- trunk/toolkits/basemap/examples/plot_tissot.py Modified: trunk/toolkits/basemap/examples/plot_tissot.py === --- trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-13 13:23:15 UTC (rev 5760) +++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-13 13:24:30 UTC (rev 5761) @@ -34,7 +34,7 @@ for parallel in range(-60,61,30): for meridian in range(-165,166,30): seg = m.tissot(meridian,parallel,6,100) -poly = Polygon(seg,facecolor='green',zorder=10) +poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5) ax.add_patch(poly) # draw meridians and parallels. m.drawparallels(np.arange(-60,61,30)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5762] trunk/toolkits/basemap/doc/users/figures/aea .py
Revision: 5762 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5762&view=rev Author: jswhit Date: 2008-07-13 06:27:33 -0700 (Sun, 13 Jul 2008) Log Message: --- update Modified Paths: -- trunk/toolkits/basemap/doc/users/figures/aea.py Modified: trunk/toolkits/basemap/doc/users/figures/aea.py === --- trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 13:24:30 UTC (rev 5761) +++ trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 13:27:33 UTC (rev 5762) @@ -6,7 +6,7 @@ # lat_1 is first standard parallel. # lat_2 is second standard parallel. # lon_0,lat_0 is central point. -m = Basemap(width=800,height=600, +m = Basemap(width=800,height=700, resolution='l',projection='aea',\ lat_1=40.,lat_2=60,lon_0=35,lat_0=50) m.drawcoastlines() @@ -18,7 +18,7 @@ m.drawmapboundary(fill_color='aqua') # draw tissot's indicatrix to show distortion. ax = plt.gca() -for y in np.linspace(m.ymax/20,19*m.ymax/20,9): +for y in np.linspace(m.ymax/20,19*m.ymax/20,10): for x in np.linspace(m.xmax/20,19*m.xmax/20,12): lon, lat = m(x,y,inverse=True) seg = m.tissot(lon,lat,1.,100) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5763] trunk/toolkits/basemap
Revision: 5763
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5763&view=rev
Author: jswhit
Date: 2008-07-13 13:29:55 -0700 (Sun, 13 Jul 2008)
Log Message:
---
have tissot method do actual drawing.
Modified Paths:
--
trunk/toolkits/basemap/examples/plot_tissot.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/examples/plot_tissot.py
===
--- trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-13 13:27:33 UTC
(rev 5762)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-13 20:29:55 UTC
(rev 5763)
@@ -2,7 +2,6 @@
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.basemap import __version__ as basemap_version
-from matplotlib.patches import Polygon
# Tissot's Indicatrix (http://en.wikipedia.org/wiki/Tissot's_Indicatrix).
# These diagrams illustrate the distortion inherent in all map projections.
@@ -29,13 +28,10 @@
for m in [m1,m2,m3,m4,m5]:
# make a new figure.
fig = plt.figure()
-ax = plt.gca()
# draw "circles" at specified longitudes and latitudes.
for parallel in range(-60,61,30):
for meridian in range(-165,166,30):
-seg = m.tissot(meridian,parallel,6,100)
-poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
-ax.add_patch(poly)
+poly =
m.tissot(meridian,parallel,6,100,facecolor='green',zorder=10,alpha=0.5)
# draw meridians and parallels.
m.drawparallels(np.arange(-60,61,30))
m.drawmeridians(np.arange(-180,180,60))
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-13
13:27:33 UTC (rev 5762)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-13
20:29:55 UTC (rev 5763)
@@ -2146,16 +2146,30 @@
if v == ([], []): del linecolls[k]
return linecolls
-def tissot(self,lon_0,lat_0,radius_deg,npts):
+def tissot(self,lon_0,lat_0,radius_deg,npts,ax=None,**kwargs):
"""
-create list of ``npts`` x,y pairs that are equidistant on the
-surface of the earth from central point ``lon_0,lat_0`` and form
-an ellipse with radius of ``radius_deg`` degrees of latitude along
-longitude ``lon_0``.
-The ellipse represents a Tissot's indicatrix
+Draw a polygon centered at ``lon_0,lat_0``. The polygon
+approximates a circle on the surface of the earth with radius
+``radius_deg`` degrees latitude along longitude ``lon_0``,
+made up of ``npts`` vertices.
+The polygon represents a Tissot's indicatrix
(http://en.wikipedia.org/wiki/Tissot's_Indicatrix),
which when drawn on a map shows the distortion
-inherent in the map projection."""
+inherent in the map projection.
+
+Extra keyword ``ax`` can be used to override the default axis instance.
+
+Other \**kwargs passed on to matplotlib.patches.Polygon."""
+if not kwargs.has_key('ax') and self.ax is None:
+try:
+ax = plt.gca()
+except:
+import matplotlib.pyplot as plt
+ax = plt.gca()
+elif not kwargs.has_key('ax') and self.ax is not None:
+ax = self.ax
+else:
+ax = kwargs.pop('ax')
g = pyproj.Geod(a=self.rmajor,b=self.rminor)
az12,az21,dist = g.inv(lon_0,lat_0,lon_0,lat_0+radius_deg)
seg = [self(lon_0,lat_0+radius_deg)]
@@ -2172,7 +2186,11 @@
# add segment if it is in the map projection region.
if x < 1.e20 and y < 1.e20:
seg.append((x,y))
-return seg
+poly = Polygon(seg,**kwargs)
+ax.add_patch(poly)
+# set axes limits to fit map region.
+self.set_axes_limits(ax=ax)
+return poly
def gcpoints(self,lon1,lat1,lon2,lat2,npoints):
"""
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5764] trunk/matplotlib/lib/matplotlib/collections. py
Revision: 5764 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5764&view=rev Author: efiring Date: 2008-07-13 13:51:25 -0700 (Sun, 13 Jul 2008) Log Message: --- Fix PatchCollection bug found by Ryan May Modified Paths: -- trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/lib/matplotlib/collections.py === --- trunk/matplotlib/lib/matplotlib/collections.py 2008-07-13 20:29:55 UTC (rev 5763) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-07-13 20:51:25 UTC (rev 5764) @@ -888,7 +888,7 @@ if match_original: def determine_facecolor(patch): -if patch.fill(): +if patch.fill: return patch.get_facecolor() return [0, 0, 0, 0] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [5765] trunk/toolkits/basemap/doc/users/figures
Revision: 5765
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5765&view=rev
Author: jswhit
Date: 2008-07-13 18:58:13 -0700 (Sun, 13 Jul 2008)
Log Message:
---
fixes for updated tissot method.
Modified Paths:
--
trunk/toolkits/basemap/doc/users/figures/aea.py
trunk/toolkits/basemap/doc/users/figures/eqdc.py
trunk/toolkits/basemap/doc/users/figures/laea.py
trunk/toolkits/basemap/doc/users/figures/lcc.py
trunk/toolkits/basemap/doc/users/figures/stere.py
Modified: trunk/toolkits/basemap/doc/users/figures/aea.py
===
--- trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-13 20:51:25 UTC
(rev 5764)
+++ trunk/toolkits/basemap/doc/users/figures/aea.py 2008-07-14 01:58:13 UTC
(rev 5765)
@@ -1,7 +1,6 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
-from matplotlib.patches import Polygon
# setup albers equal area conic basemap
# lat_1 is first standard parallel.
# lat_2 is second standard parallel.
@@ -21,8 +20,7 @@
for y in np.linspace(m.ymax/20,19*m.ymax/20,10):
for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
lon, lat = m(x,y,inverse=True)
-seg = m.tissot(lon,lat,1.,100)
-poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
-ax.add_patch(poly)
+poly = m.tissot(lon,lat,1.25,100,\
+facecolor='green',zorder=10,alpha=0.5)
plt.title("Albers Equal Area Projection")
plt.savefig('aea.png')
Modified: trunk/toolkits/basemap/doc/users/figures/eqdc.py
===
--- trunk/toolkits/basemap/doc/users/figures/eqdc.py2008-07-13 20:51:25 UTC
(rev 5764)
+++ trunk/toolkits/basemap/doc/users/figures/eqdc.py2008-07-14 01:58:13 UTC
(rev 5765)
@@ -1,7 +1,6 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
-from matplotlib.patches import Polygon
# setup equidistant conic basemap.
# lat_1 is first standard parallel.
# lat_2 is second standard parallel.
@@ -20,8 +19,7 @@
for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
lon, lat = m(x,y,inverse=True)
-seg = m.tissot(lon,lat,1.5,100)
-poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
-ax.add_patch(poly)
+poly = m.tissot(lon,lat,1.5,100,\
+facecolor='green',zorder=10,alpha=0.5)
plt.title("Equidistant Conic Projection")
plt.savefig('eqdc.png')
Modified: trunk/toolkits/basemap/doc/users/figures/laea.py
===
--- trunk/toolkits/basemap/doc/users/figures/laea.py2008-07-13 20:51:25 UTC
(rev 5764)
+++ trunk/toolkits/basemap/doc/users/figures/laea.py2008-07-14 01:58:13 UTC
(rev 5765)
@@ -1,7 +1,6 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
-from matplotlib.patches import Polygon
# setup lambert azimuthal equal area basemap.
# lat_ts is latitude of true scale.
# lon_0,lat_0 is central point.
@@ -19,8 +18,7 @@
for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
lon, lat = m(x,y,inverse=True)
-seg = m.tissot(lon,lat,1.5,100)
-poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
-ax.add_patch(poly)
+poly = m.tissot(lon,lat,1.5,100,\
+facecolor='green',zorder=10,alpha=0.5)
plt.title("Lambert Azimuthal Equal Area Projection")
plt.savefig('laea.png')
Modified: trunk/toolkits/basemap/doc/users/figures/lcc.py
===
--- trunk/toolkits/basemap/doc/users/figures/lcc.py 2008-07-13 20:51:25 UTC
(rev 5764)
+++ trunk/toolkits/basemap/doc/users/figures/lcc.py 2008-07-14 01:58:13 UTC
(rev 5765)
@@ -1,7 +1,6 @@
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
-from matplotlib.patches import Polygon
# setup lambert conformal basemap.
# lat_1 is first standard parallel.
# lat_2 is second standard parallel (defaults to lat_1).
@@ -24,8 +23,7 @@
for y in np.linspace(m.ymax/20,19*m.ymax/20,9):
for x in np.linspace(m.xmax/20,19*m.xmax/20,12):
lon, lat = m(x,y,inverse=True)
-seg = m.tissot(lon,lat,1.5,100)
-poly = Polygon(seg,facecolor='green',zorder=10,alpha=0.5)
-ax.add_patch(poly)
+poly = m.tissot(lon,lat,1.5,100,\
+facecolor='green',zorder=10,alpha=0.5)
plt.title("Lambert Conformal Projection")
plt.savefig('lcc.png')
Modified: trunk/toolkits/basemap/doc/users/figures/stere.py
===
--- trunk/toolkits/basemap/doc/users/figures/stere.py 2008-07-13 20:51:25 UTC
(rev 5764)
+++ trunk/toolkits/basemap/doc/user
