Revision: 8606
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8606&view=rev
Author:   leejjoon
Date:     2010-07-31 09:18:25 +0000 (Sat, 31 Jul 2010)

Log Message:
-----------
make grid spec iterable

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

Modified: trunk/matplotlib/lib/matplotlib/gridspec.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/gridspec.py 2010-07-31 09:18:20 UTC (rev 
8605)
+++ trunk/matplotlib/lib/matplotlib/gridspec.py 2010-07-31 09:18:25 UTC (rev 
8606)
@@ -128,6 +128,12 @@
         return figBottoms, figTops, figLefts, figRights
 
 
+    def __iter__(self):
+        nrows, ncols = self.get_geometry()
+        total = nrows*ncols
+
+        return iter([self.__getitem__(i) for i in range(total)])
+
     def __getitem__(self, key):
         """
         create and return a SuplotSpec instance.


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

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to