|
From: <lee...@us...> - 2010-07-31 09:18:31
|
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.
|