diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py index 40a1d2b0f62d..dd12d490cb93 100644 --- a/lib/matplotlib/contour.py +++ b/lib/matplotlib/contour.py @@ -1161,7 +1161,7 @@ def _process_contour_level_args(self, args): inside = (self.levels > self.zmin) & (self.levels < self.zmax) levels_in = self.levels[inside] if len(levels_in) == 0: - self.levels = [self.zmin] + self.levels = [np.nan] cbook._warn_external( "No contour levels were found within the data range.")