Revision: 7607
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7607&view=rev
Author: leejjoon
Date: 2009-08-31 00:32:12 +0000 (Mon, 31 Aug 2009)
Log Message:
-----------
fix sf bug #2839919
Modified Paths:
--------------
branches/v0_99_maint/lib/matplotlib/legend.py
Modified: branches/v0_99_maint/lib/matplotlib/legend.py
===================================================================
--- branches/v0_99_maint/lib/matplotlib/legend.py 2009-08-30 20:26:05 UTC (rev 7606)
+++ branches/v0_99_maint/lib/matplotlib/legend.py 2009-08-31 00:32:12 UTC (rev 7607)
@@ -587,8 +587,9 @@
# We calculate number of lows in each column. The first
# (num_largecol) columns will have (nrows+1) rows, and remaing
# (num_smallcol) columns will have (nrows) rows.
- nrows, num_largecol = divmod(len(handleboxes), self._ncol)
- num_smallcol = self._ncol-num_largecol
+ ncol = min(self._ncol, len(handleboxes))
+ nrows, num_largecol = divmod(len(handleboxes), ncol)
+ num_smallcol = ncol-num_largecol
# starting index of each column and number of rows in it.
largecol = safezip(range(0, num_largecol*(nrows+1), (nrows+1)),
@@ -849,3 +850,4 @@
return ox, oy
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|