Revision: 6746
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6746&view=rev
Author:   efiring
Date:     2009-01-06 19:22:09 +0000 (Tue, 06 Jan 2009)

Log Message:
-----------
Fix bug in setting of negative contour linestyles.

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

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2009-01-06 18:59:31 UTC (rev 6745)
+++ trunk/matplotlib/CHANGELOG  2009-01-06 19:22:09 UTC (rev 6746)
@@ -1,6 +1,8 @@
+2009-01-06 Fix bug in setting of dashed negative contours. - EF
+
 2009-01-06 Be fault tolerant when len(linestyles)>NLev in contour. - MM
 
-2009-01-06 Added marginals kwarg to hexbin to plot marginal densities 
+2009-01-06 Added marginals kwarg to hexbin to plot marginal densities
            JDH
 
 2009-01-06 Change user-visible multipage pdf object to PdfPages to

Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py  2009-01-06 18:59:31 UTC (rev 
6745)
+++ trunk/matplotlib/lib/matplotlib/contour.py  2009-01-06 19:22:09 UTC (rev 
6746)
@@ -535,7 +535,7 @@
         self.levels = kwargs.get('levels', None)
         self.filled = kwargs.get('filled', False)
         self.linewidths = kwargs.get('linewidths', None)
-        self.linestyles = kwargs.get('linestyles', 'solid')
+        self.linestyles = kwargs.get('linestyles', None)
 
         self.alpha = kwargs.get('alpha', 1.0)
         self.origin = kwargs.get('origin', None)
@@ -613,9 +613,6 @@
                                      linestyle = lstyle,
                                      alpha=self.alpha)
 
-                if level < 0.0 and self.monochrome:
-                    ls = mpl.rcParams['contour.negative_linestyle']
-                    col.set_linestyle(ls)
                 col.set_label('_nolegend_')
                 self.ax.add_collection(col, False)
                 self.collections.append(col)
@@ -857,6 +854,11 @@
         Nlev = len(self.levels)
         if linestyles is None:
             tlinestyles = ['solid'] * Nlev
+            if self.monochrome:
+                neg_ls = mpl.rcParams['contour.negative_linestyle']
+                for i, lev in enumerate(self.levels):
+                    if lev < 0.0:
+                        tlinestyles[i] = neg_ls
         else:
             if cbook.is_string_like(linestyles):
                 tlinestyles = [linestyles] * Nlev


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to