SF.net SVN: matplotlib: [5735] trunk/matplotlib/doc/users/artists.rst

2008-07-11 Thread dsdale
Revision: 5735
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5735&view=rev
Author:   dsdale
Date: 2008-07-11 05:18:43 -0700 (Fri, 11 Jul 2008)

Log Message:
---
fixed a couple typos in artists.rst

Modified Paths:
--
trunk/matplotlib/doc/users/artists.rst

Modified: trunk/matplotlib/doc/users/artists.rst
===
--- trunk/matplotlib/doc/users/artists.rst  2008-07-10 18:59:18 UTC (rev 
5734)
+++ trunk/matplotlib/doc/users/artists.rst  2008-07-11 12:18:43 UTC (rev 
5735)
@@ -68,19 +68,20 @@
 of ``[left, bottom, width, height]`` values in 0-1 relative figure
 coordinates::
 
-ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
+fig2 = plt.figure()
+ax2 = fig2.add_axes([0.15, 0.1, 0.7, 0.3])
 
 Continuing with our example::
 
 import numpy as np
 t = np.arange(0.0, 1.0, 0.01)
 s = np.sin(2*np.pi*t)
-line, = ax1.plot(t, s, color='blue', lw=2)
+line, = ax.plot(t, s, color='blue', lw=2)
 
 In this example, ``ax`` is the ``Axes`` instance created by the
 ``fig.add_subplot`` call above (remember ``Subplot`` is just a
-subclass of ``Axes``) and when you call ``ax.plot``, it creates a
-``Line2D`` instance and adds it the the :attr:`Axes.lines
+subclass of ``Axes``) and when you call ``ax.plot``, it createsa
+``Line2D`` instance and adds it the :attr:`Axes.lines
 ` list.  In the interactive `ipython
 `_ session below, you can see that
 ``Axes.lines`` list is length one and contains the same line that was


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: [5736] trunk/matplotlib/doc/sphinxext/ inheritance_diagram.py

2008-07-11 Thread mdboom
Revision: 5736
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5736&view=rev
Author:   mdboom
Date: 2008-07-11 07:36:49 -0700 (Fri, 11 Jul 2008)

Log Message:
---
Minor updates to inheritance diagram.

Modified Paths:
--
trunk/matplotlib/doc/sphinxext/inheritance_diagram.py

Modified: trunk/matplotlib/doc/sphinxext/inheritance_diagram.py
===
--- trunk/matplotlib/doc/sphinxext/inheritance_diagram.py   2008-07-11 
12:18:43 UTC (rev 5735)
+++ trunk/matplotlib/doc/sphinxext/inheritance_diagram.py   2008-07-11 
14:36:49 UTC (rev 5736)
@@ -145,8 +145,9 @@
 """
 module = cls.__module__
 if module == '__builtin__':
-return cls.__name__
-fullname = '.'.join([module, cls.__name__])
+fullname = cls.__name__
+else:
+fullname = "%s.%s" % (module, cls.__name__)
 if parts == 0:
 return fullname
 name_parts = fullname.split('.')
@@ -299,6 +300,9 @@
 node['content'] = " ".join(class_names)
 return [node]
 
+def get_graph_hash(node):
+return md5(node['content'] + str(node['parts'])).hexdigest()[-10:]
+
 def html_output_graph(self, node):
 """
 Output the graph for HTML.  This will insert a PNG with clickable
@@ -307,11 +311,9 @@
 graph = node['graph']
 parts = node['parts']
 
-# Determine where to write the PNG to.  This follows
-# the same procedure as mathpng.py
-name = 'inheritance%s' % md5(
-node['content'] + str(node['parts'])).hexdigest()[-10:]
-png_path = '_static/%s.png' % name
+graph_hash = get_graph_hash(node)
+name = "inheritance%s" % graph_hash
+png_path = os.path.join('_static', name + ".png")
 
 path = '_static'
 source = self.document.attributes['source']
@@ -346,24 +348,14 @@
 graph = node['graph']
 parts = node['parts']
 
-# Determine where to write the PNG to.  This follows
-# the same procedure as mathpng.py
-name = 'inheritance%s' % md5(
-node['content'] + str(node['parts'])).hexdigest()[-10:]
-pdf_path = '_static/%s.pdf' % name
+graph_hash = get_graph_hash(node)
+name = "inheritance%s"
+pdf_path = os.path.join('_static', name + ".pdf")
 
-path = '_static'
-source = self.document.attributes['source']
-count = source.split('/doc/')[-1].count('/')
-for i in range(count):
-if os.path.exists(path): break
-path = '../'+path
-path = '../'+path #specifically added for matplotlib
+graph.run_dot(['-Tpdf', '-o%s' % pdf_path],
+  name, parts, graph_options={'size': '"6.0,6.0"'})
+return '\\includegraphics{../../%s}' % pdf_path
 
-graph.run_dot(['-Tpdf', '-o%s' % pdf_path], name, parts,
-  graph_options={'size': '"6.0,6.0"'})
-return '\\includegraphics{../../_static/%s.pdf}' % name
-
 def visit_inheritance_diagram(inner_func):
 """
 This is just a wrapper around html/latex_output_graph to make it


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: [5737] trunk/toolkits/basemap/examples/plot_tissot. py

2008-07-11 Thread jswhit
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 figu

SF.net SVN: matplotlib: [5738] trunk/toolkits/basemap/examples

2008-07-11 Thread jswhit
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.

-
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: [5739] trunk/toolkits/basemap/examples/README

2008-07-11 Thread jswhit
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.

-
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: [5740] trunk/toolkits/basemap/MANIFEST.in

2008-07-11 Thread jswhit
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.

-
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: [5741] trunk/toolkits/basemap

2008-07-11 Thread jswhit
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/Changelog2008-07-11 15:05:09 UTC (rev 5740)
+++ trunk/toolkits/basemap/Changelog2008-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.allcl

SF.net SVN: matplotlib: [5742] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py

2008-07-11 Thread jswhit
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.

-
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: [5743] trunk/toolkits/basemap/examples/plot_tissot. py

2008-07-11 Thread jswhit
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.

-
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: [5744] trunk/toolkits/basemap

2008-07-11 Thread jswhit
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/Changelog2008-07-11 15:45:55 UTC (rev 5743)
+++ trunk/toolkits/basemap/Changelog2008-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.

-
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: [5745] trunk/toolkits/basemap/examples/plot_tissot. py

2008-07-11 Thread jswhit
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.

-
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: [5746] trunk/toolkits/basemap/lib/mpl_toolkits/ basemap/__init__.py

2008-07-11 Thread jswhit
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.

-
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: [5747] trunk/matplotlib

2008-07-11 Thread mdboom
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.py2008-07-11 16:30:07 UTC (rev 
5746)
+++ trunk/matplotlib/lib/matplotlib/cbook.py2008-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.

-
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

SF.net SVN: matplotlib: [5748] trunk/matplotlib/lib/matplotlib/axes.py

2008-07-11 Thread mdboom
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.

-
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