diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index cfb19bf95001..75659a3d7323 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1232,9 +1232,9 @@ def _process_levels(self): # ...except that extended layers must be outside the # normed range: if self.extend in ('both', 'min'): - self.layers[0] = -np.inf + self.layers[0] = -1e150 if self.extend in ('both', 'max'): - self.layers[-1] = np.inf + self.layers[-1] = 1e150 def _process_colors(self): """