Revision: 6769
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6769&view=rev
Author:   mmetz_bn
Date:     2009-01-08 19:58:26 +0000 (Thu, 08 Jan 2009)

Log Message:
-----------
Minor code cleanup in contour

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

Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py  2009-01-08 19:55:06 UTC (rev 
6768)
+++ trunk/matplotlib/lib/matplotlib/contour.py  2009-01-08 19:58:26 UTC (rev 
6769)
@@ -840,15 +840,16 @@
         linewidths = self.linewidths
         Nlev = len(self.levels)
         if linewidths is None:
-            tlinewidths = [(mpl.rcParams['lines.linewidth'],)] *Nlev
+            tlinewidths = [(mpl.rcParams['lines.linewidth'],)] * Nlev
         else:
             if not cbook.iterable(linewidths):
                 linewidths = [linewidths] * Nlev
             else:
                 linewidths = list(linewidths)
                 if len(linewidths) < Nlev:
-                    linewidths = linewidths * 
int(np.ceil(Nlev/len(linewidths)))
-                if len(linewidths) > Nlev:
+                    nreps = int(np.ceil(Nlev/len(linewidths)))
+                    linewidths = linewidths * nreps
+                elif len(linewidths) > Nlev:
                     linewidths = linewidths[:Nlev]
             tlinewidths = [(w,) for w in linewidths]
         return tlinewidths
@@ -871,7 +872,7 @@
                 if len(tlinestyles) < Nlev:
                     nreps = int(np.ceil(Nlev/len(linestyles)))
                     tlinestyles = tlinestyles * nreps
-                if len(tlinestyles) > Nlev:
+                elif len(tlinestyles) > Nlev:
                     tlinestyles = tlinestyles[:Nlev]
             else:
                 raise ValueError("Unrecognized type for linestyles kwarg")


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

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to