@@ -75,13 +75,14 @@ def clabel(self, *args, **kwargs):
7575 levels = self .levels
7676 indices = range (len (self .levels ))
7777 elif len (args ) == 1 :
78+ levlabs = list (args [0 ])
7879 indices , levels = [], []
7980 for i , lev in enumerate (self .levels ):
80- if lev in args [ 0 ] :
81+ if lev in levlabs :
8182 indices .append (i )
8283 levels .append (lev )
83- if len (levels ) < len (args [ 0 ] ):
84- msg = "Specified levels " + str (levels )
84+ if len (levels ) < len (levlabs ):
85+ msg = "Specified levels " + str (levlabs )
8586 msg += "\n don't match available levels "
8687 msg += str (self .levels )
8788 raise ValueError (msg )
@@ -426,7 +427,8 @@ def __init__(self, ax, *args, **kwargs):
426427 self .linewidths = 0.05 # Good default for Postscript.
427428 if iterable (self .linewidths ):
428429 self .linewidths = self .linewidths [0 ]
429- C = _contour .Cntr (x , y , z .filled (), z .mask ())
430+ #C = _contour.Cntr(x, y, z.filled(), z.mask())
431+ C = _contour .Cntr (x , y , z .filled (), ma .getmask (z ))
430432 lowers = self .levels [:- 1 ]
431433 uppers = self .levels [1 :]
432434 for level , level_upper , color in zip (lowers , uppers , self .tcolors ):
@@ -441,7 +443,8 @@ def __init__(self, ax, *args, **kwargs):
441443
442444 else :
443445 tlinewidths = self ._process_linewidths ()
444- C = _contour .Cntr (x , y , z .filled (), z .mask ())
446+ #C = _contour.Cntr(x, y, z.filled(), z.mask())
447+ C = _contour .Cntr (x , y , z .filled (), ma .getmask (z ))
445448 for level , color , width in zip (self .levels , self .tcolors , tlinewidths ):
446449 nlist = C .trace (level , points = 1 )
447450 col = LineCollection (nlist )
0 commit comments