You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <js...@us...> - 2008-07-13 13:24:33
|
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.
|
|
From: <js...@us...> - 2008-07-13 13:23:18
|
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.rst 2008-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.rst 2008-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 2008-07-13 13:23:15 UTC (rev 5760)
@@ -35,6 +35,7 @@
azeqd.rst
gnomon.rst
ortho.rst
+ geos.rst
moll.rst
robin.rst
sinu.rst
@@ -43,4 +44,10 @@
merc.rst
tmerc.rst
omerc.rst
+ poly.rst
mill.rst
+ lcc.rst
+ laea.rst
+ stere.rst
+ eqdc.rst
+ aea.rst
Added: trunk/toolkits/basemap/doc/users/poly.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/poly.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/poly.rst 2008-07-13 13:23:15 UTC (rev 5760)
@@ -0,0 +1,8 @@
+.. _poly:
+
+Polyconic Projection
+====================
+
+.. literalinclude:: figures/poly.py
+
+.. image:: figures/poly.png
Added: trunk/toolkits/basemap/doc/users/stere.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/stere.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/stere.rst 2008-07-13 13:23:15 UTC (rev 5760)
@@ -0,0 +1,15 @@
+.. _stere:
+
+Stereographic 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/stere.py
+
+.. image:: figures/stere.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-13 13:18:17
|
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.py 2008-07-13 13:03:48 UTC (rev 5758)
+++ trunk/toolkits/basemap/doc/users/figures/poly.py 2008-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.
|
|
From: <js...@us...> - 2008-07-13 13:03:51
|
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.
|
|
From: <js...@us...> - 2008-07-13 12:59:48
|
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=12000000,height=9000000,
+m = Basemap(width=8000000,height=6000000,
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.py 2008-07-13 12:31:53 UTC (rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/eqdc.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 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.py 2008-07-13 12:31:53 UTC (rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/laea.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 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(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 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 12:31:53 UTC (rev 5756)
+++ trunk/toolkits/basemap/doc/users/figures/stere.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 stereographic 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("Stereographic Projection")
plt.savefig('stere.png')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-13 12:31:56
|
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=16700000,width=12000000,
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.
|
|
From: <js...@us...> - 2008-07-13 12:31:51
|
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=12000000,height=9000000,
+ 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.py 2008-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=12000000,height=9000000,
+ 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.py 2008-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='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('Geostationary Map Showing A Quadrant of the Globe')
+plt.savefig('geos_partial.png')
Added: trunk/toolkits/basemap/doc/users/figures/laea.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/laea.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/laea.py 2008-07-13 12:31:46 UTC (rev 5755)
@@ -0,0 +1,17 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup lambert azimuthal equal area basemap.
+# lat_ts is latitude of true scale.
+# lon_0,lat_0 is central point.
+m = Basemap(width=12000000,height=8000000,
+ resolution='l',projection='laea',\
+ lat_ts=50,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("Lambert Azimuthal Equal Area Projection")
+plt.savefig('laea.png')
Added: trunk/toolkits/basemap/doc/users/figures/lcc.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/lcc.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/lcc.py 2008-07-13 12:31:46 UTC (rev 5755)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup lambert conformal basemap.
+# lat_1 is first standard parallel.
+# lat_2 is second standard parallel (defaults to lat_1).
+# lon_0,lat_0 is central point.
+# rsphere=(6378137.00,6356752.3142) specifies WGS4 ellipsoid
+# area_thresh=1000 means don't plot coastline features less
+# than 1000 km^2 in area.
+m = Basemap(width=12000000,height=9000000,
+ rsphere=(6378137.00,6356752.3142),\
+ resolution='l',area_thresh=1000.,projection='lcc',\
+ 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("Lambert Conformal Projection")
+plt.savefig('lcc.png')
Added: trunk/toolkits/basemap/doc/users/figures/poly.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/poly.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/poly.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 lccconic 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',\
+ lat_0=0.,lon_0=20.)
+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("Polyconic Projection")
+plt.savefig('poly.png')
Added: trunk/toolkits/basemap/doc/users/figures/stere.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/stere.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/stere.py 2008-07-13 12:31:46 UTC (rev 5755)
@@ -0,0 +1,17 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup stereographic basemap.
+# lat_ts is latitude of true scale.
+# lon_0,lat_0 is central point.
+m = Basemap(width=12000000,height=8000000,
+ resolution='l',projection='stere',\
+ lat_ts=50,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("Stereographic Projection")
+plt.savefig('stere.png')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-07-12 21:33:56
|
Revision: 5754
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5754&view=rev
Author: jdh2358
Date: 2008-07-12 14:33:54 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
added support for external backends
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/backends/__init__.py
trunk/matplotlib/lib/matplotlib/backends/backend_template.py
trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/CHANGELOG 2008-07-12 21:33:54 UTC (rev 5754)
@@ -1,3 +1,6 @@
+2008-07-12 Added support for external backends with the
+ "module://my_backend" syntax - JDH
+
2008-07-11 Fix memory leak related to shared axes. Grouper should
store weak references. - MGD
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/__init__.py 2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-07-12 21:33:54 UTC (rev 5754)
@@ -801,8 +801,11 @@
if warn: warnings.warn(_use_error_msg)
return
arg = arg.lower()
- be_parts = arg.split('.')
- name = validate_backend(be_parts[0])
+ if arg.startswith('module://'):
+ name = arg
+ else:
+ be_parts = arg.split('.')
+ name = validate_backend(be_parts[0])
rcParams['backend'] = name
if name == 'cairo' and len(be_parts) > 1:
rcParams['cairo.format'] = validate_cairo_format(be_parts[1])
Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2008-07-12 21:33:54 UTC (rev 5754)
@@ -1,10 +1,7 @@
import matplotlib
-from matplotlib.rcsetup import interactive_bk
-from matplotlib.rcsetup import non_interactive_bk
-from matplotlib.rcsetup import all_backends
-from matplotlib.rcsetup import validate_backend
+
__all__ = ['backend','show','draw_if_interactive',
'new_figure_manager', 'backend_version']
@@ -14,28 +11,24 @@
'return new_figure_manager, draw_if_interactive and show for pylab'
# Import the requested backend into a generic module object
- backend_name = 'backend_'+backend
- backend_name = backend_name.lower() # until we banish mixed case
- backend_mod = __import__('matplotlib.backends.'+backend_name,
+ if backend.startswith('module://'):
+ backend_name = backend[9:]
+ else:
+ backend_name = 'backend_'+backend
+ backend_name = backend_name.lower() # until we banish mixed case
+ backend_name = 'matplotlib.backends.%s'%backend_name.lower()
+ backend_mod = __import__(backend_name,
globals(),locals(),[backend_name])
# Things we pull in from all backends
new_figure_manager = backend_mod.new_figure_manager
- if hasattr(backend_mod,'backend_version'):
- backend_version = getattr(backend_mod,'backend_version')
- else: backend_version = 'unknown'
+ def do_nothing(*args, **kwargs): pass
+ backend_version = getattr(backend_mod,'backend_version', 'unknown')
+ show = getattr(backend_mod, 'show', do_nothing)
+ draw_if_interactive = getattr(backend_mod, 'draw_if_interactive', do_nothing)
-
- # Now define the public API according to the kind of backend in use
- if backend in interactive_bk:
- show = backend_mod.show
- draw_if_interactive = backend_mod.draw_if_interactive
- else: # non-interactive backends
- def draw_if_interactive(): pass
- def show(): pass
-
# Additional imports which only happen for certain backends. This section
# should probably disappear once all backends are uniform.
if backend.lower() in ['wx','wxagg']:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_template.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_template.py 2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_template.py 2008-07-12 21:33:54 UTC (rev 5754)
@@ -17,7 +17,7 @@
with 'xxx'. Then implement the class methods and functions below, and
add 'xxx' to the switchyard in matplotlib/backends/__init__.py and
'xxx' to the backends list in the validate_backend methon in
-matplotlib/__init__.py and you're off. You can use your backend with
+matplotlib/__init__.py and you're off. You can use your backend with::
import matplotlib
matplotlib.use('xxx')
@@ -25,6 +25,17 @@
plot([1,2,3])
show()
+matplotlib also supports external backends, so you can place you can
+use any module in your PYTHONPATH with the syntax::
+
+ import matplotlib
+ matplotlib.use('module://my_backend')
+
+where my_backend.py is your module name. Thus syntax is also
+recognized in the rc file and in the -d argument in pylab, eg::
+
+ python simple_plot.py -dmodule://my_backend
+
The files that are most relevant to backend_writers are
matplotlib/backends/backend_your_backend.py
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-07-12 21:15:00 UTC (rev 5753)
+++ trunk/matplotlib/matplotlibrc.template 2008-07-12 21:33:54 UTC (rev 5754)
@@ -19,8 +19,12 @@
# such as 0.75 - a legal html color name, eg red, blue, darkslategray
#### CONFIGURATION BEGINS HERE
+
# the default backend; one of GTK GTKAgg GTKCairo CocoaAgg FltkAgg
-# QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template
+# QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template You
+# can also deploy your own backend outside of matplotlib by referring
+# to the module name (which must be in the PYTHONPATH) as
+# 'module://my_backend'
backend : %(backend)s
numerix : %(numerix)s # numpy, Numeric or numarray
#maskedarray : False # True to use external maskedarray module
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-07-12 21:15:04
|
Revision: 5753
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5753&view=rev
Author: efiring
Date: 2008-07-12 14:15:00 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
Handle markeredgecolor=None etc. consistently
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/lines.py
Modified: branches/v0_91_maint/lib/matplotlib/lines.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/lines.py 2008-07-12 21:04:09 UTC (rev 5752)
+++ branches/v0_91_maint/lib/matplotlib/lines.py 2008-07-12 21:15:00 UTC (rev 5753)
@@ -238,12 +238,6 @@
if linestyle is None : linestyle=rcParams['lines.linestyle']
if marker is None : marker=rcParams['lines.marker']
if color is None : color=rcParams['lines.color']
- if markeredgecolor is None :
- markeredgecolor='auto'
- if markerfacecolor is None :
- markerfacecolor='auto'
- if markeredgewidth is None :
- markeredgewidth=rcParams['lines.markeredgewidth']
if markersize is None : markersize=rcParams['lines.markersize']
if antialiased is None : antialiased=rcParams['lines.antialiased']
@@ -654,6 +648,8 @@
ACCEPTS: any matplotlib color
"""
+ if ec is None:
+ ec = 'auto'
self._markeredgecolor = ec
def set_markeredgewidth(self, ew):
@@ -662,6 +658,8 @@
ACCEPTS: float value in points
"""
+ if ew is None:
+ ew = rcParams['lines.markeredgewidth']
self._markeredgewidth = ew
def set_markerfacecolor(self, fc):
@@ -670,6 +668,8 @@
ACCEPTS: any matplotlib color
"""
+ if fc is None:
+ fc = 'auto'
self._markerfacecolor = fc
def set_markersize(self, sz):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-07-12 21:04:12
|
Revision: 5752
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5752&view=rev
Author: efiring
Date: 2008-07-12 14:04:09 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
Handle markerfacecolor=None etc. consistenty
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py 2008-07-12 13:22:55 UTC (rev 5751)
+++ trunk/matplotlib/lib/matplotlib/lines.py 2008-07-12 21:04:09 UTC (rev 5752)
@@ -215,12 +215,6 @@
if linestyle is None : linestyle=rcParams['lines.linestyle']
if marker is None : marker=rcParams['lines.marker']
if color is None : color=rcParams['lines.color']
- if markeredgecolor is None :
- markeredgecolor='auto'
- if markerfacecolor is None :
- markerfacecolor='auto'
- if markeredgewidth is None :
- markeredgewidth=rcParams['lines.markeredgewidth']
if markersize is None : markersize=rcParams['lines.markersize']
if antialiased is None : antialiased=rcParams['lines.antialiased']
@@ -628,6 +622,8 @@
ACCEPTS: any matplotlib color
"""
+ if ec is None :
+ ec = 'auto'
self._markeredgecolor = ec
def set_markeredgewidth(self, ew):
@@ -636,6 +632,8 @@
ACCEPTS: float value in points
"""
+ if ew is None :
+ ew = rcParams['lines.markeredgewidth']
self._markeredgewidth = ew
def set_markerfacecolor(self, fc):
@@ -644,6 +642,8 @@
ACCEPTS: any matplotlib color
"""
+ if fc is None :
+ fc = 'auto'
self._markerfacecolor = fc
def set_markersize(self, sz):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-12 13:23:01
|
Revision: 5751
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5751&view=rev
Author: jswhit
Date: 2008-07-12 06:22:55 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
add some color
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-12 12:30:11 UTC (rev 5750)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-12 13:22:55 UTC (rev 5751)
@@ -41,7 +41,8 @@
m.drawmeridians(np.arange(-180,180,60))
# draw coastlines, fill continents, plot title.
m.drawcoastlines()
- m.fillcontinents()
+ m.drawmapboundary(fill_color='aqua')
+ m.fillcontinents(color='coral',lake_color='aqua')
title = 'Tissot Diagram: projection = %s' % m.projection
print title
plt.title(title)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-12 12:30:13
|
Revision: 5750
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5750&view=rev
Author: jswhit
Date: 2008-07-12 05:30:11 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
fix docstring typos
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-12 12:29:16 UTC (rev 5749)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-12 12:30:11 UTC (rev 5750)
@@ -257,7 +257,7 @@
lat_1 first standard parallel for lambert conformal,
albers equal area and equidistant conic.
Latitude of one of the two points on the projection
- for oblique mercator. If lat_1 is not given, but
+ centerline for oblique mercator. If lat_1 is not given, but
lat_0 is, lat_1 is set to lat_0 for lambert
conformal, albers equal area and equidistant conic.
lat_2 second standard parallel for lambert conformal,
@@ -266,9 +266,9 @@
centerline for oblique mercator. If lat_2 is not
given it is set to lat_1 for lambert conformal,
albers equal area and equidistant conic.
- lon_1 longitude of one of the two points on the projection
+ lon_1 Longitude of one of the two points on the projection
centerline for oblique mercator.
- lon_2 longitude of one of the two points on the projection
+ lon_2 Longitude of one of the two points on the projection
centerline for oblique mercator.
no_rot only used by oblique mercator.
If set to True, the map projection coordinates will
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-12 12:29:17
|
Revision: 5749
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5749&view=rev
Author: jswhit
Date: 2008-07-12 05:29:16 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
add omerc example
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/mapsetup.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/figures/omerc.py
trunk/toolkits/basemap/doc/users/omerc.rst
Added: trunk/toolkits/basemap/doc/users/figures/omerc.py
===================================================================
--- trunk/toolkits/basemap/doc/users/figures/omerc.py (rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/omerc.py 2008-07-12 12:29:16 UTC (rev 5749)
@@ -0,0 +1,22 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup oblique mercator basemap.
+# width is width of map projection region in km (xmax-xmin_
+# height is height of map projection region in km (ymax-ymin)
+# lon_0, lat_0 are the central longitude and latitude of the projection.
+# lat_1,lon_1 and lat_2,lon_2 are two pairs of points that define
+# the projection centerline.
+# Map projection coordinates are automatically rotated to true north.
+# To avoid this, set no_rot=True.
+m = Basemap(height=16700000,width=12000000,
+ 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)
+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("Oblique Mercator Projection")
+plt.savefig('omerc.png')
Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-11 18:31:04 UTC (rev 5748)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst 2008-07-12 12:29:16 UTC (rev 5749)
@@ -42,4 +42,5 @@
cass.rst
merc.rst
tmerc.rst
+ omerc.rst
mill.rst
Added: trunk/toolkits/basemap/doc/users/omerc.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/omerc.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/omerc.rst 2008-07-12 12:29:16 UTC (rev 5749)
@@ -0,0 +1,14 @@
+.. _omerc:
+
+Oblique Mercator Projection
+===========================
+
+The oblique aspect of the mercator projection.
+The projection centerline, instead of being a latitude (as in
+the regular mercator projection) or a longitude (as in the
+transverse mercator projection) can be an
+arbitrary great circle (defined by specifying two points).
+
+.. literalinclude:: figures/omerc.py
+
+.. image:: figures/omerc.png
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-11 18:31:07
|
Revision: 5748
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5748&view=rev
Author: mdboom
Date: 2008-07-11 11:31:04 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Typo in last commit
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-11 18:21:53 UTC (rev 5747)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-11 18:31:04 UTC (rev 5748)
@@ -904,8 +904,8 @@
self.xaxis.set_clip_path(self.patch)
self.yaxis.set_clip_path(self.patch)
- self._shared_x_axes.clear()
- self._shared_y_axes.clear()
+ self._shared_x_axes.clean()
+ self._shared_y_axes.clean()
def clear(self):
'clear the axes'
@@ -6032,7 +6032,7 @@
right
"""
- ax2 = self.figure.add_axes(self.get_position(True), sharex=self,
+ ax2 = self.figure.add_axes(self.get_position(True), # sharex=self,
frameon=False)
ax2.yaxis.tick_right()
ax2.yaxis.set_label_position('right')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-07-11 18:21:57
|
Revision: 5747
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5747&view=rev
Author: mdboom
Date: 2008-07-11 11:21:53 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Fix memory leak when using shared axes.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/cbook.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-07-11 16:30:07 UTC (rev 5746)
+++ trunk/matplotlib/CHANGELOG 2008-07-11 18:21:53 UTC (rev 5747)
@@ -1,3 +1,6 @@
+2008-07-11 Fix memory leak related to shared axes. Grouper should
+ store weak references. - MGD
+
2008-07-10 Bugfix: crash displaying fontconfig pattern - MGD
2008-07-10 Bugfix: [ 2013963 ] update_datalim_bounds in Axes not works - MGD
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-11 16:30:07 UTC (rev 5746)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-11 18:21:53 UTC (rev 5747)
@@ -904,6 +904,8 @@
self.xaxis.set_clip_path(self.patch)
self.yaxis.set_clip_path(self.patch)
+ self._shared_x_axes.clear()
+ self._shared_y_axes.clear()
def clear(self):
'clear the axes'
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-07-11 16:30:07 UTC (rev 5746)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-07-11 18:21:53 UTC (rev 5747)
@@ -6,6 +6,7 @@
import re, os, errno, sys, StringIO, traceback, locale, threading
import time, datetime
import numpy as np
+from weakref import ref
major, minor1, minor2, s, tmp = sys.version_info
@@ -1042,24 +1043,34 @@
def __init__(self, init=[]):
mapping = self._mapping = {}
for x in init:
- mapping[x] = [x]
+ mapping[ref(x)] = [ref(x)]
def __contains__(self, item):
- return item in self._mapping
+ return ref(item) in self._mapping
+ def clean(self):
+ """
+ Clean dead weak references from the dictionary
+ """
+ mapping = self._mapping
+ for key, val in mapping.items():
+ if key() is None:
+ del mapping[key]
+ val.remove(key)
+
def join(self, a, *args):
"""
Join given arguments into the same set. Accepts one or more
arguments.
"""
mapping = self._mapping
- set_a = mapping.setdefault(a, [a])
+ set_a = mapping.setdefault(ref(a), [ref(a)])
for arg in args:
- set_b = mapping.get(arg)
+ set_b = mapping.get(ref(arg))
if set_b is None:
- set_a.append(arg)
- mapping[arg] = set_a
+ set_a.append(ref(arg))
+ mapping[ref(arg)] = set_a
elif set_b is not set_a:
if len(set_b) > len(set_a):
set_a, set_b = set_b, set_a
@@ -1067,13 +1078,17 @@
for elem in set_b:
mapping[elem] = set_a
+ self.clean()
+
def joined(self, a, b):
"""
Returns True if *a* and *b* are members of the same set.
"""
+ self.clean()
+
mapping = self._mapping
try:
- return mapping[a] is mapping[b]
+ return mapping[ref(a)] is mapping[ref(b)]
except KeyError:
return False
@@ -1083,6 +1098,8 @@
The iterator is invalid if interleaved with calls to join().
"""
+ self.clean()
+
class Token: pass
token = Token()
@@ -1090,7 +1107,7 @@
# and don't yield it twice
for group in self._mapping.itervalues():
if not group[-1] is token:
- yield group
+ yield [x() for x in group]
group.append(token)
# Cleanup the tokens
@@ -1102,9 +1119,12 @@
"""
Returns all of the items joined with *a*, including itself.
"""
- return self._mapping.get(a, [a])
+ self.clean()
+ siblings = self._mapping.get(ref(a), [ref(a)])
+ return [x() for x in siblings]
+
def simple_linear_interpolation(a, steps):
steps = np.floor(steps)
new_length = ((len(a) - 1) * steps) + 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 16:30:11
|
Revision: 5746
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5746&view=rev
Author: jswhit
Date: 2008-07-11 09:30:07 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:50:28 UTC (rev 5745)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 16:30:07 UTC (rev 5746)
@@ -2153,7 +2153,7 @@
an ellipse with radius of ``radius_deg`` degrees of latitude along
longitude ``lon_0``.
The ellipse represents a Tissot's indicatrix
- (http://en.wikipedia.org/wiki/Tissot%27s_Indicatrix),
+ (http://en.wikipedia.org/wiki/Tissot's_Indicatrix),
which when drawn on a map shows the distortion
inherent in the map projection."""
g = pyproj.Geod(a=self.rmajor,b=self.rminor)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:50:34
|
Revision: 5745
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5745&view=rev
Author: jswhit
Date: 2008-07-11 08:50:28 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
check for required Basemap version.
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-11 15:48:04 UTC (rev 5744)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-11 15:50:28 UTC (rev 5745)
@@ -1,6 +1,7 @@
import numpy as np
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).
@@ -11,6 +12,10 @@
# Tissot's indicatrix have all unit area, although their shapes and
# orientations vary with location.
+# requires Basemap version 0.99.1
+if basemap_version < '0.99.1':
+ raise SystemExit("this example requires Basemap version 0.99.1 or higher")
+
# create Basemap instances with several different projections
m1 = Basemap(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
projection='cyl')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:48:14
|
Revision: 5744
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5744&view=rev
Author: jswhit
Date: 2008-07-11 08:48:04 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
up version number to 0.99.1
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
trunk/toolkits/basemap/setup.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-07-11 15:45:55 UTC (rev 5743)
+++ trunk/toolkits/basemap/Changelog 2008-07-11 15:48:04 UTC (rev 5744)
@@ -1,3 +1,4 @@
+version 0.99.1 (not yet released)
* added "tissot" method for generating Tissot's indicatrix
(see example plot_tissot.py).
* fixed processing of coastlines for gnomonic projection.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:45:55 UTC (rev 5743)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:48:04 UTC (rev 5744)
@@ -41,7 +41,7 @@
# basemap data files now installed in lib/matplotlib/toolkits/basemap/data
basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
-__version__ = '0.99'
+__version__ = '0.99.1'
# supported map projections.
_projnames = {'cyl' : 'Cylindrical Equidistant',
Modified: trunk/toolkits/basemap/setup.py
===================================================================
--- trunk/toolkits/basemap/setup.py 2008-07-11 15:45:55 UTC (rev 5743)
+++ trunk/toolkits/basemap/setup.py 2008-07-11 15:48:04 UTC (rev 5744)
@@ -189,7 +189,7 @@
package_data = {'mpl_toolkits.basemap':pyproj_datafiles+basemap_datafiles}
setup(
name = "basemap",
- version = "0.99",
+ version = "0.99.1",
description = "Plot data on map projections with matplotlib",
long_description = """
An add-on toolkit for matplotlib that lets you plot data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:45:58
|
Revision: 5743
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5743&view=rev
Author: jswhit
Date: 2008-07-11 08:45:55 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
eliminate uneeded import
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-11 15:41:48 UTC (rev 5742)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-11 15:45:55 UTC (rev 5743)
@@ -1,7 +1,6 @@
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
-from mpl_toolkits.basemap import pyproj
from matplotlib.patches import Polygon
# Tissot's Indicatrix (http://en.wikipedia.org/wiki/Tissot's_Indicatrix).
@@ -16,6 +15,7 @@
m1 = Basemap(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
projection='cyl')
m2 = Basemap(lon_0=-60,lat_0=45,projection='ortho')
+# use WGS84 ellipsoid in this one.
m3 = Basemap(llcrnrlon=-180,llcrnrlat=-70,urcrnrlon=180,urcrnrlat=70,
projection='merc',lat_ts=20,rsphere=(6378137.0,6356752.3142))
m4 = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:41:52
|
Revision: 5742
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5742&view=rev
Author: jswhit
Date: 2008-07-11 08:41:48 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:39:08 UTC (rev 5741)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:41:48 UTC (rev 5742)
@@ -2163,7 +2163,7 @@
az = az12
for n in range(npts):
az = az+delaz
- # skip segments along equator (Geod can't handel equatorial arcs)
+ # skip segments along equator (Geod can't handle equatorial arcs)
if np.allclose(0.,lat_0) and (np.allclose(90.,az) or np.allclose(270.,az)):
continue
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:39:10
|
Revision: 5741
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5741&view=rev
Author: jswhit
Date: 2008-07-11 08:39:08 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
added tissot method.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/examples/plot_tissot.py
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-07-11 15:05:09 UTC (rev 5740)
+++ trunk/toolkits/basemap/Changelog 2008-07-11 15:39:08 UTC (rev 5741)
@@ -1,3 +1,5 @@
+ * added "tissot" method for generating Tissot's indicatrix
+ (see example plot_tissot.py).
* fixed processing of coastlines for gnomonic projection.
* don't try to use PyNIO in NetCDFFile (it was causing
too many suprises).
Modified: trunk/toolkits/basemap/examples/plot_tissot.py
===================================================================
--- trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-11 15:05:09 UTC (rev 5740)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-11 15:39:08 UTC (rev 5741)
@@ -12,43 +12,14 @@
# Tissot's indicatrix have all unit area, although their shapes and
# orientations vary with location.
-class Basemap2(Basemap):
- def tissot(self,lon_0,lat_0,radius_deg,npts):
- # create list of npts lon,lat pairs that are equidistant on the
- # surface of the earth from central point lon_0,lat_0
- # and has radius along lon_0 of radius_deg degrees of latitude.
- # points are transformed to map projection coordinates.
- # The ellipse that list of points represents is a
- # Tissot's indicatrix
- # (http://en.wikipedia.org/wiki/Tissot%27s_Indicatrix),
- # which when drawn on a map shows the distortion
- # inherent in the map projection.
- 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)]
- delaz = 360./npts
- az = az12
- for n in range(npts):
- az = az+delaz
- # skip segments along equator (Geod can't handel equatorial arcs)
- if np.allclose(0.,lat_0) and (np.allclose(90.,az) or np.allclose(270.,az)):
- continue
- else:
- lon, lat, az21 = g.fwd(lon_0, lat_0, az, dist)
- x,y = self(lon,lat)
- # add segment if it is in the map projection region.
- if x < 1.e20 and y < 1.e20:
- seg.append((x,y))
- return seg
-
# create Basemap instances with several different projections
-m1 = Basemap2(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
+m1 = Basemap(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
projection='cyl')
-m2 = Basemap2(lon_0=-60,lat_0=45,projection='ortho')
-m3 = Basemap2(llcrnrlon=-180,llcrnrlat=-70,urcrnrlon=180,urcrnrlat=70,
+m2 = Basemap(lon_0=-60,lat_0=45,projection='ortho')
+m3 = Basemap(llcrnrlon=-180,llcrnrlat=-70,urcrnrlon=180,urcrnrlat=70,
projection='merc',lat_ts=20,rsphere=(6378137.0,6356752.3142))
-m4 = Basemap2(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
-m5 = Basemap2(lon_0=270,lat_0=90,boundinglat=10,projection='nplaea')
+m4 = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
+m5 = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='nplaea')
for m in [m1,m2,m3,m4,m5]:
# make a new figure.
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:05:09 UTC (rev 5740)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-07-11 15:39:08 UTC (rev 5741)
@@ -2146,6 +2146,34 @@
if v == ([], []): del linecolls[k]
return linecolls
+ def tissot(self,lon_0,lat_0,radius_deg,npts):
+ """
+ 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
+ (http://en.wikipedia.org/wiki/Tissot%27s_Indicatrix),
+ which when drawn on a map shows the distortion
+ inherent in the map projection."""
+ 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)]
+ delaz = 360./npts
+ az = az12
+ for n in range(npts):
+ az = az+delaz
+ # skip segments along equator (Geod can't handel equatorial arcs)
+ if np.allclose(0.,lat_0) and (np.allclose(90.,az) or np.allclose(270.,az)):
+ continue
+ else:
+ lon, lat, az21 = g.fwd(lon_0, lat_0, az, dist)
+ x,y = self(lon,lat)
+ # add segment if it is in the map projection region.
+ if x < 1.e20 and y < 1.e20:
+ seg.append((x,y))
+ return seg
+
def gcpoints(self,lon1,lat1,lon2,lat2,npoints):
"""
compute ``points`` points along a great circle with endpoints
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:05:14
|
Revision: 5740
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5740&view=rev
Author: jswhit
Date: 2008-07-11 08:05:09 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
update for plot_tissot change.
Modified Paths:
--------------
trunk/toolkits/basemap/MANIFEST.in
Modified: trunk/toolkits/basemap/MANIFEST.in
===================================================================
--- trunk/toolkits/basemap/MANIFEST.in 2008-07-11 15:04:49 UTC (rev 5739)
+++ trunk/toolkits/basemap/MANIFEST.in 2008-07-11 15:05:09 UTC (rev 5740)
@@ -62,9 +62,6 @@
include examples/cities.dbf
include examples/cities.shp
include examples/cities.shx
-include examples/tissot.dbf
-include examples/tissot.shp
-include examples/tissot.shx
include examples/show_colormaps.py
include examples/plotprecip.py
include examples/nws_precip_conus_20061222.nc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:04:52
|
Revision: 5739
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5739&view=rev
Author: jswhit
Date: 2008-07-11 08:04:49 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
update for plot_tissot change
Modified Paths:
--------------
trunk/toolkits/basemap/examples/README
Modified: trunk/toolkits/basemap/examples/README
===================================================================
--- trunk/toolkits/basemap/examples/README 2008-07-11 15:04:22 UTC (rev 5738)
+++ trunk/toolkits/basemap/examples/README 2008-07-11 15:04:49 UTC (rev 5739)
@@ -97,7 +97,7 @@
'llcrnrlat','llcrnrlon','urcrnrlat','urcrnrlon') are given in setwh.py.
plot_tissot.py - tissot's indicatrix, shows the distorting effects of
-different map projections. Exercises the shapefile methods.
+different map projections.
pnganim.py shows how to make an animation.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:04:29
|
Revision: 5738
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5738&view=rev
Author: jswhit
Date: 2008-07-11 08:04:22 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
don't need anymore
Removed Paths:
-------------
trunk/toolkits/basemap/examples/tissot.dbf
trunk/toolkits/basemap/examples/tissot.shp
trunk/toolkits/basemap/examples/tissot.shx
Deleted: trunk/toolkits/basemap/examples/tissot.dbf
===================================================================
(Binary files differ)
Deleted: trunk/toolkits/basemap/examples/tissot.shp
===================================================================
(Binary files differ)
Deleted: trunk/toolkits/basemap/examples/tissot.shx
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-07-11 15:03:56
|
Revision: 5737
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5737&view=rev
Author: jswhit
Date: 2008-07-11 08:03:53 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
don't use shapefiles.
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-11 14:36:49 UTC (rev 5736)
+++ trunk/toolkits/basemap/examples/plot_tissot.py 2008-07-11 15:03:53 UTC (rev 5737)
@@ -1,6 +1,7 @@
import numpy as np
import matplotlib.pyplot as plt
-from mpl_toolkits.basemap import Basemap as Basemap
+from mpl_toolkits.basemap import Basemap
+from mpl_toolkits.basemap import pyproj
from matplotlib.patches import Polygon
# Tissot's Indicatrix (http://en.wikipedia.org/wiki/Tissot's_Indicatrix).
@@ -11,90 +12,62 @@
# Tissot's indicatrix have all unit area, although their shapes and
# orientations vary with location.
-# adapted from http://www.perrygeo.net/wordpress/?p=4
+class Basemap2(Basemap):
+ def tissot(self,lon_0,lat_0,radius_deg,npts):
+ # create list of npts lon,lat pairs that are equidistant on the
+ # surface of the earth from central point lon_0,lat_0
+ # and has radius along lon_0 of radius_deg degrees of latitude.
+ # points are transformed to map projection coordinates.
+ # The ellipse that list of points represents is a
+ # Tissot's indicatrix
+ # (http://en.wikipedia.org/wiki/Tissot%27s_Indicatrix),
+ # which when drawn on a map shows the distortion
+ # inherent in the map projection.
+ 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)]
+ delaz = 360./npts
+ az = az12
+ for n in range(npts):
+ az = az+delaz
+ # skip segments along equator (Geod can't handel equatorial arcs)
+ if np.allclose(0.,lat_0) and (np.allclose(90.,az) or np.allclose(270.,az)):
+ continue
+ else:
+ lon, lat, az21 = g.fwd(lon_0, lat_0, az, dist)
+ x,y = self(lon,lat)
+ # add segment if it is in the map projection region.
+ if x < 1.e20 and y < 1.e20:
+ seg.append((x,y))
+ return seg
-# create new figure
-fig=plt.figure()
-m = Basemap(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
- projection='cyl')
-shp_info = m.readshapefile('tissot','tissot',drawbounds=True)
-ax = plt.gca()
-for nshape,seg in enumerate(m.tissot):
- poly = Polygon(seg,facecolor='green',zorder=10)
- ax.add_patch(poly)
-# draw meridians and parallels.
-m.drawparallels(np.arange(-90,91,30),labels=[1,0,0,0])
-m.drawmeridians(np.arange(-180,180,60),labels=[0,0,0,1])
-m.drawcoastlines()
-m.fillcontinents()
-plt.title('Tissot Diagram - Cylindrical Equal Area')
-print 'plot Cylindrical Equidistant Equal Area Tissot diagram ...'
+# create Basemap instances with several different projections
+m1 = Basemap2(llcrnrlon=-180,llcrnrlat=-80,urcrnrlon=180,urcrnrlat=80,
+ projection='cyl')
+m2 = Basemap2(lon_0=-60,lat_0=45,projection='ortho')
+m3 = Basemap2(llcrnrlon=-180,llcrnrlat=-70,urcrnrlon=180,urcrnrlat=70,
+ projection='merc',lat_ts=20,rsphere=(6378137.0,6356752.3142))
+m4 = Basemap2(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
+m5 = Basemap2(lon_0=270,lat_0=90,boundinglat=10,projection='nplaea')
-# create new figure
-fig=plt.figure()
-m = Basemap(llcrnrlon=-180,llcrnrlat=-70,urcrnrlon=180,urcrnrlat=70,
- projection='merc',lat_ts=20)
-shp_info = m.readshapefile('tissot','tissot',drawbounds=True)
-ax = plt.gca()
-for nshape,seg in enumerate(m.tissot):
- poly = Polygon(seg,facecolor='green',zorder=10)
- ax.add_patch(poly)
-# draw meridians and parallels.
-m.drawparallels(np.arange(-90,91,30),labels=[1,0,0,0])
-m.drawmeridians(np.arange(-180,180,60),labels=[0,0,0,1])
-m.drawcoastlines()
-m.fillcontinents()
-plt.title('Tissot Diagram - Mercator Conformal')
-print 'plot Mercator Conformal Tissot diagram ...'
+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)
+ ax.add_patch(poly)
+ # draw meridians and parallels.
+ m.drawparallels(np.arange(-60,61,30))
+ m.drawmeridians(np.arange(-180,180,60))
+ # draw coastlines, fill continents, plot title.
+ m.drawcoastlines()
+ m.fillcontinents()
+ title = 'Tissot Diagram: projection = %s' % m.projection
+ print title
+ plt.title(title)
-# create new figure
-fig=plt.figure()
-m = Basemap(lon_0=-60,lat_0=45,projection='ortho')
-shp_info = m.readshapefile('tissot','tissot',drawbounds=False)
-ax = plt.gca()
-for nshape,seg in enumerate(m.tissot):
- xx,yy = zip(*seg)
- if max(xx) < 1.e20 and max(yy) < 1.e20:
- poly = Polygon(seg,facecolor='green',zorder=10)
- ax.add_patch(poly)
-m.drawcoastlines()
-m.fillcontinents()
-m.drawparallels(np.arange(-90,91,30))
-m.drawmeridians(np.arange(-180,180,30))
-plt.title('Tissot Diagram - Orthographic')
-m.drawmapboundary()
-plt.gca().set_frame_on(True)
-print 'plot Orthographic Tissot diagram ...'
-
-# create new figure
-fig=plt.figure()
-m = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
-shp_info = m.readshapefile('tissot','tissot',drawbounds=True)
-ax = plt.gca()
-for nshape,seg in enumerate(m.tissot):
- poly = Polygon(seg,facecolor='green',zorder=10)
- ax.add_patch(poly)
-# draw meridians and parallels.
-m.drawparallels(np.arange(-90,91,30),labels=[1,0,0,0])
-m.drawmeridians(np.arange(-180,180,30),labels=[0,0,0,1])
-m.drawcoastlines()
-m.fillcontinents()
-plt.title('Tissot Diagram - North Polar Stereographic Conformal')
-print 'plot North Polar Stereographic Conformal Tissot diagram ...'
-
-# create new figure
-fig=plt.figure()
-m = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='nplaea')
-shp_info = m.readshapefile('tissot','tissot',drawbounds=True)
-ax = plt.gca()
-for nshape,seg in enumerate(m.tissot):
- poly = Polygon(seg,facecolor='green',zorder=10)
- ax.add_patch(poly)
-# draw meridians and parallels.
-m.drawparallels(np.arange(-90,91,30),labels=[1,0,0,0])
-m.drawmeridians(np.arange(-180,180,30),labels=[0,0,0,1])
-m.drawcoastlines()
-m.fillcontinents()
-plt.title('Tissot Diagram - North Polar Lambert Azimuthal Equal Area')
-print 'plot North Polar Lambert Azimuthal Equal Area Tissot diagram ...'
plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|