Skip to content

Commit 848e77e

Browse files
committed
BUG: fix contour zmin, zmax types to work with LinearLocator
Closes #6270 Also removes an unused argument from the _autolev method.
1 parent 1156e23 commit 848e77e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/matplotlib/contour.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ def changed(self):
11301130
# add label colors
11311131
cm.ScalarMappable.changed(self)
11321132

1133-
def _autolev(self, z, N):
1133+
def _autolev(self, N):
11341134
"""
11351135
Select contour levels to span the data.
11361136
@@ -1166,12 +1166,12 @@ def _contour_level_args(self, z, args):
11661166
self._auto = False
11671167
if self.levels is None:
11681168
if len(args) == 0:
1169-
lev = self._autolev(z, 7)
1169+
lev = self._autolev(7)
11701170
else:
11711171
level_arg = args[0]
11721172
try:
11731173
if type(level_arg) == int:
1174-
lev = self._autolev(z, level_arg)
1174+
lev = self._autolev(level_arg)
11751175
else:
11761176
lev = np.asarray(level_arg).astype(np.float64)
11771177
except:
@@ -1531,12 +1531,12 @@ def _contour_args(self, args, kwargs):
15311531
raise TypeError("Too many arguments to %s; see help(%s)" %
15321532
(fn, fn))
15331533
z = ma.masked_invalid(z, copy=False)
1534-
self.zmax = ma.maximum(z)
1535-
self.zmin = ma.minimum(z)
1534+
self.zmax = float(z.max())
1535+
self.zmin = float(z.min())
15361536
if self.logscale and self.zmin <= 0:
15371537
z = ma.masked_where(z <= 0, z)
15381538
warnings.warn('Log scale: values of z <= 0 have been masked')
1539-
self.zmin = z.min()
1539+
self.zmin = float(z.min())
15401540
self._contour_level_args(z, args)
15411541
return (x, y, z)
15421542

0 commit comments

Comments
 (0)