diff --git a/xarray/plot/utils.py b/xarray/plot/utils.py index 5510cf7f219..a83bc28e273 100644 --- a/xarray/plot/utils.py +++ b/xarray/plot/utils.py @@ -60,6 +60,9 @@ def _build_discrete_cmap(cmap, levels, extend, filled): """ import matplotlib as mpl + if len(levels) == 1: + levels = [levels[0], levels[0]] + if not filled: # non-filled contour plots extend = "max"