SF.net SVN: matplotlib: [5766] trunk/toolkits/basemap/doc/users/figures

2008-07-14 Thread jswhit
Revision: 5766
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5766&view=rev
Author:   jswhit
Date: 2008-07-14 04:55:41 -0700 (Mon, 14 Jul 2008)

Log Message:
---
final examples added.

Modified Paths:
--
trunk/toolkits/basemap/doc/users/figures/stere.py

Added Paths:
---
trunk/toolkits/basemap/doc/users/figures/aeqd.py
trunk/toolkits/basemap/doc/users/figures/npaeqd.py
trunk/toolkits/basemap/doc/users/figures/nplaea.py
trunk/toolkits/basemap/doc/users/figures/npstere.py
trunk/toolkits/basemap/doc/users/figures/spaeqd.py
trunk/toolkits/basemap/doc/users/figures/splaea.py
trunk/toolkits/basemap/doc/users/figures/spstere.py

Added: trunk/toolkits/basemap/doc/users/figures/aeqd.py
===
--- trunk/toolkits/basemap/doc/users/figures/aeqd.py
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/aeqd.py2008-07-14 11:55:41 UTC 
(rev 5766)
@@ -0,0 +1,20 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+width = 2800; lon_0 = -105; lat_0 = 40
+m = Basemap(width=width,height=width,projection='aeqd',
+lat_0=lat_0,lon_0=lon_0)
+# fill background.
+m.drawmapboundary(fill_color='aqua')
+# draw coasts and fill continents.
+m.drawcoastlines(linewidth=0.5)
+m.fillcontinents(color='coral',lake_color='aqua')
+# 20 degree graticule.
+m.drawparallels(np.arange(-80,81,20))
+m.drawmeridians(np.arange(-180,180,20))
+# draw a black dot at the center.
+xpt, ypt = m(lon_0, lat_0)
+m.plot([xpt],[ypt],'ko') 
+# draw the title.
+plt.title('Azimuthal Equidistant Projection')
+plt.savefig('aeqd.png')

Added: trunk/toolkits/basemap/doc/users/figures/npaeqd.py
===
--- trunk/toolkits/basemap/doc/users/figures/npaeqd.py  
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/npaeqd.py  2008-07-14 11:55:41 UTC 
(rev 5766)
@@ -0,0 +1,24 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
+# setup north polar aimuthal equidistant basemap.
+# The longitude lon_0 is at 6-o'clock, and the
+# latitude circle boundinglat is tangent to the edge  
+# of the map at lon_0.
+m = Basemap(projection='npaeqd',boundinglat=10,lon_0=270,resolution='l')
+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') 
+# draw tissot's indicatrix to show distortion.
+ax = plt.gca()
+for y in np.linspace(m.ymax/20,19*m.ymax/20,10):
+for x in np.linspace(m.xmax/20,19*m.xmax/20,10):
+lon, lat = m(x,y,inverse=True)
+poly = m.tissot(lon,lat,2.5,100,\
+facecolor='green',zorder=10,alpha=0.5)
+plt.title("North Polar Azimuthal Equidistant Projection")
+plt.savefig('npaeqd.png')

Added: trunk/toolkits/basemap/doc/users/figures/nplaea.py
===
--- trunk/toolkits/basemap/doc/users/figures/nplaea.py  
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/nplaea.py  2008-07-14 11:55:41 UTC 
(rev 5766)
@@ -0,0 +1,24 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+from matplotlib.patches import Polygon
+# setup north polar lambert azimuthal basemap.
+# The longitude lon_0 is at 6-o'clock, and the
+# latitude circle boundinglat is tangent to the edge  
+# of the map at lon_0.
+m = Basemap(projection='nplaea',boundinglat=10,lon_0=270,resolution='l')
+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') 
+# draw tissot's indicatrix to show distortion.
+ax = plt.gca()
+for y in np.linspace(m.ymax/20,19*m.ymax/20,10):
+for x in np.linspace(m.xmax/20,19*m.xmax/20,10):
+lon, lat = m(x,y,inverse=True)
+poly = m.tissot(lon,lat,2.5,100,\
+facecolor='green',zorder=10,alpha=0.5)
+plt.title("North Polar Lambert Azimuthal Projection")
+plt.savefig('nplaea.png')

Added: trunk/toolkits/basemap/doc/users/figures/npstere.py
===
--- trunk/toolkits/basemap/doc/users/figures/npstere.py 
(rev 0)
+++ trunk/toolkits/basemap/doc/users/figures/npstere.py 2008-07-14 11:55:41 UTC 
(rev 5766)
@@ -0,0 +1,24 @@
+from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
+# setup north polar stereographic basemap.
+# The longitude lon_0 is at 6-o'clock, and the
+# latitude circle boundinglat is tangent to the edge  
+# of the map at lon_

SF.net SVN: matplotlib: [5767] trunk/toolkits/basemap/doc/users

2008-07-14 Thread jswhit
Revision: 5767
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5767&view=rev
Author:   jswhit
Date: 2008-07-14 05:10:34 -0700 (Mon, 14 Jul 2008)

Log Message:
---
add final examples.

Modified Paths:
--
trunk/toolkits/basemap/doc/users/mapsetup.rst

Added Paths:
---
trunk/toolkits/basemap/doc/users/aeqd.rst
trunk/toolkits/basemap/doc/users/paeqd.rst
trunk/toolkits/basemap/doc/users/plaea.rst
trunk/toolkits/basemap/doc/users/pstere.rst

Removed Paths:
-
trunk/toolkits/basemap/doc/users/azeqd.rst

Added: trunk/toolkits/basemap/doc/users/aeqd.rst
===
--- trunk/toolkits/basemap/doc/users/aeqd.rst   (rev 0)
+++ trunk/toolkits/basemap/doc/users/aeqd.rst   2008-07-14 12:10:34 UTC (rev 
5767)
@@ -0,0 +1,15 @@
+.. _aeqd:
+
+Azimuthal Equidistant Projection
+
+
+The shortest route from the center of the map
+to any other point is a straight line in the azimuthal
+equidistant projection. 
+So, for the specified point, all points that lie on a circle around
+this point are equidistant on the surface of the earth on this projection.
+The specified point ``lon_0, lat_0`` shows up as a black dot in the center of 
the map.
+
+.. literalinclude:: figures/aeqd.py
+
+.. image:: figures/aeqd.png

Deleted: trunk/toolkits/basemap/doc/users/azeqd.rst
===
--- trunk/toolkits/basemap/doc/users/azeqd.rst  2008-07-14 11:55:41 UTC (rev 
5766)
+++ trunk/toolkits/basemap/doc/users/azeqd.rst  2008-07-14 12:10:34 UTC (rev 
5767)
@@ -1,15 +0,0 @@
-.. _azeqd:
-
-Azimuthal Equidistant Projection
-
-
-The shortest route from the center of the map
-to any other point is a straight line in the azimuthal
-equidistant projection. 
-So, for the specified point, all points that lie on a circle around
-this point are equidistant on the surface of the earth on this projection.
-The specified point ``lon_0, lat_0`` shows up as a black dot in the center of 
the map.
-
-.. literalinclude:: figures/azeqd.py
-
-.. image:: figures/azeqd.png

Modified: trunk/toolkits/basemap/doc/users/mapsetup.rst
===
--- trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-14 11:55:41 UTC 
(rev 5766)
+++ trunk/toolkits/basemap/doc/users/mapsetup.rst   2008-07-14 12:10:34 UTC 
(rev 5767)
@@ -32,7 +32,7 @@
 
 .. toctree::
 
-azeqd.rst
+aeqd.rst
 gnomon.rst
 ortho.rst
 geos.rst
@@ -51,3 +51,6 @@
 stere.rst
 eqdc.rst
 aea.rst
+pstere.rst
+plaea.rst
+paeqd.rst

Added: trunk/toolkits/basemap/doc/users/paeqd.rst
===
--- trunk/toolkits/basemap/doc/users/paeqd.rst  (rev 0)
+++ trunk/toolkits/basemap/doc/users/paeqd.rst  2008-07-14 12:10:34 UTC (rev 
5767)
@@ -0,0 +1,15 @@
+.. _paeqd:
+
+Polar Azimuthal Equidistant Projection
+==
+
+For convenience, the projections ``npaeqd`` and ``spaeqd`` are provided 
+for easy access to the polar aspect of the azimuthal equidistant projection.
+
+.. literalinclude:: figures/npaeqd.py
+
+.. image:: figures/npaeqd.png
+
+.. literalinclude:: figures/spaeqd.py
+
+.. image:: figures/spaeqd.png

Added: trunk/toolkits/basemap/doc/users/plaea.rst
===
--- trunk/toolkits/basemap/doc/users/plaea.rst  (rev 0)
+++ trunk/toolkits/basemap/doc/users/plaea.rst  2008-07-14 12:10:34 UTC (rev 
5767)
@@ -0,0 +1,16 @@
+.. _plaea:
+
+Polar Lambert Azimuthal Projection
+==
+
+For convenience, the projections ``nplaea`` and ``splaea`` are provided 
+for easy access to the polar aspect of the lambert azimuthal equal-area
+projection.
+
+.. literalinclude:: figures/nplaea.py
+
+.. image:: figures/nplaea.png
+
+.. literalinclude:: figures/splaea.py
+
+.. image:: figures/splaea.png

Added: trunk/toolkits/basemap/doc/users/pstere.rst
===
--- trunk/toolkits/basemap/doc/users/pstere.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/pstere.rst 2008-07-14 12:10:34 UTC (rev 
5767)
@@ -0,0 +1,15 @@
+.. _pstere:
+
+Polar Stereographic Projection
+==
+
+For convenience, the projections ``npstere`` and ``spstere`` are provided 
+for easy access to the polar aspect of the stereographic conformal projection.
+
+.. literalinclude:: figures/npstere.py
+
+.. image:: figures/npstere.png
+
+.. literalinclude:: figures/spstere.py
+
+.. image:: figures/spstere.png


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-

SF.net SVN: matplotlib: [5768] trunk/matplotlib/lib/matplotlib/collections. py

2008-07-14 Thread mdboom
Revision: 5768
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5768&view=rev
Author:   mdboom
Date: 2008-07-14 05:54:59 -0700 (Mon, 14 Jul 2008)

Log Message:
---
Remove on-line of cruft (thanks, Ryan May)

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/collections.py

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===
--- trunk/matplotlib/lib/matplotlib/collections.py  2008-07-14 12:10:34 UTC 
(rev 5767)
+++ trunk/matplotlib/lib/matplotlib/collections.py  2008-07-14 12:54:59 UTC 
(rev 5768)
@@ -93,7 +93,6 @@
 if len(offsets.shape) == 1:
 offsets = offsets[np.newaxis,:]  # Make it Nx2.
 if transOffset is not None:
-Affine2D = transforms.Affine2D
 self._offsets = offsets
 self._transOffset = transOffset
 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: [5769] trunk/matplotlib

2008-07-14 Thread jdh2358
Revision: 5769
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5769&view=rev
Author:   jdh2358
Date: 2008-07-14 08:14:02 -0700 (Mon, 14 Jul 2008)

Log Message:
---
added support for pixels or data min coords to the rectangle selector widget

Modified Paths:
--
trunk/matplotlib/doc/faq/howto_faq.rst
trunk/matplotlib/examples/widgets/rectangle_selector.py
trunk/matplotlib/lib/matplotlib/artist.py
trunk/matplotlib/lib/matplotlib/pyplot.py
trunk/matplotlib/lib/matplotlib/widgets.py

Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===
--- trunk/matplotlib/doc/faq/howto_faq.rst  2008-07-14 12:54:59 UTC (rev 
5768)
+++ trunk/matplotlib/doc/faq/howto_faq.rst  2008-07-14 15:14:02 UTC (rev 
5769)
@@ -6,6 +6,33 @@
 
 .. contents::
 
+
+.. _howto-findobj:
+
+How do I find all the objects in my figure of a certain type?
+=
+
+Every matplotlib artist (see :ref:`artist-tutorial`) has a method
+called :meth:`~matplotlib.artist.Artist.findobj` that can be used to
+recursively search the artist for any artists it may contain that meet
+some criteria (eg match all :class:`~matplotlib.lines.Line2D`
+instances or match some arbitrary filter function).  For example, the
+following snippet finds every object in the figure which has a
+`set_color` property and makes the object blue::
+
+def myfunc(x):
+   return hasattr(x, 'set_color')
+
+for o in fig.findobj(myfunc):
+   o.set_color('blue')
+
+You can also filter on class instances::
+
+import matplotlib.text as text
+for o in fig.findobj(text.Text):
+   o.set_fontstyle('italic')
+
+
 .. _howto-transparent:
 
 How do I save transparent figures?

Modified: trunk/matplotlib/examples/widgets/rectangle_selector.py
===
--- trunk/matplotlib/examples/widgets/rectangle_selector.py 2008-07-14 
12:54:59 UTC (rev 5768)
+++ trunk/matplotlib/examples/widgets/rectangle_selector.py 2008-07-14 
15:14:02 UTC (rev 5769)
@@ -29,5 +29,6 @@
 
 # drawtype is 'box' or 'line' or 'none'
 LS = RectangleSelector(current_ax, line_select_callback,
-  drawtype='box',useblit=True)
+   drawtype='box',useblit=True,
+   minspanx=5,minspany=5,spancoords='pixels')
 show()

Modified: trunk/matplotlib/lib/matplotlib/artist.py
===
--- trunk/matplotlib/lib/matplotlib/artist.py   2008-07-14 12:54:59 UTC (rev 
5768)
+++ trunk/matplotlib/lib/matplotlib/artist.py   2008-07-14 15:14:02 UTC (rev 
5769)
@@ -510,6 +510,9 @@
 
 def findobj(self, match=None):
 """
+pyplot signature:
+  findobj(o=gcf(), match=None) 
+
 recursively find all :class:matplotlib.artist.Artist instances
 contained in self
 
@@ -520,6 +523,8 @@
   - function with signature ``boolean = match(artist)`` used to filter 
matches
 
   - class instance: eg Line2D.  Only return artists of class type
+
+.. plot:: ../mpl_examples/pylab_examples/findobj_demo.py
 """
 
 if match is None: # always return True

Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===
--- trunk/matplotlib/lib/matplotlib/pyplot.py   2008-07-14 12:54:59 UTC (rev 
5768)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py   2008-07-14 15:14:02 UTC (rev 
5769)
@@ -7,7 +7,7 @@
 from matplotlib.backend_bases import FigureCanvasBase
 from matplotlib.image import imread as _imread
 from matplotlib import rcParams, rcParamsDefault, get_backend
-from matplotlib.artist import getp, get
+from matplotlib.artist import getp, get, Artist
 from matplotlib.artist import setp as _setp
 from matplotlib.axes import Axes
 from matplotlib.projections import PolarAxes
@@ -41,26 +41,11 @@
 
 
 def findobj(o=None, match=None):
-"""
-recursively find all :class:matplotlib.artist.Artist instances
-contained in artist instance *p*.  if *o* is None, use
-current figure
-
-*match* can be
-
-  - None: return all objects contained in artist (including artist)
-
-  - function with signature ``boolean = match(artist)`` used to filter 
matches
-
-  - class instance: eg Line2D.  Only return artists of class type
-
-"""
-
 if o is None:
 o = gcf()
 return o.findobj(match)
+findobj.__doc__ = Artist.findobj.__doc__
 
-
 def switch_backend(newbackend):
 """
 Switch the default backend to newbackend.  This feature is

Modified: trunk/matplotlib/lib/matplotlib/widgets.py
===
--- trunk/matplotlib/lib/matplotlib/widgets.py  2008-07-14 12:54:59 UTC (rev 
5768)
+++ trunk/matplotlib/lib/matplotlib/widgets.py  2008-07-14 15:14:02 UTC (rev 
5769)
@@ -979,7 +979,7 

SF.net SVN: matplotlib: [5770] trunk/toolkits/basemap/examples/plot_tissot. py

2008-07-14 Thread jswhit
Revision: 5770
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5770&view=rev
Author:   jswhit
Date: 2008-07-14 09:42:52 -0700 (Mon, 14 Jul 2008)

Log Message:
---
add moll and robin examples

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-14 15:14:02 UTC 
(rev 5769)
+++ trunk/toolkits/basemap/examples/plot_tissot.py  2008-07-14 16:42:52 UTC 
(rev 5770)
@@ -19,13 +19,14 @@
 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))
+ projection='merc',lat_ts=20)
 m4 = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='npstere')
 m5 = Basemap(lon_0=270,lat_0=90,boundinglat=10,projection='nplaea')
+m6 = Basemap(lon_0=0,projection='moll')
+m7 = Basemap(lon_0=0,projection='robin')
 
-for m in [m1,m2,m3,m4,m5]:
+for m in [m1,m2,m3,m4,m5,m6,m7]:
 # make a new figure.
 fig = plt.figure()
 # draw "circles" at specified longitudes and latitudes.


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