Skip to content

Commit

Permalink
Merge pull request #1 from veenstrajelmer/patch-1
Browse files Browse the repository at this point in the history
Update utils.py
  • Loading branch information
veenstrajelmer authored Feb 23, 2023
2 parents 3d84b2c + 0a288a2 commit c9e4a41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xarray/plot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,11 @@ def _determine_cmap_params(
if extend is None:
extend = _determine_extend(calc_data, vmin, vmax)

if levels is not None or isinstance(norm, mpl.colors.BoundaryNorm):
if levels is not None:
cmap, newnorm = _build_discrete_cmap(cmap, levels, extend, filled)
norm = newnorm if norm is None else norm
if isinstance(norm, mpl.colors.BoundaryNorm):
cmap, norm = _build_discrete_cmap(cmap, levels, extend, filled)

# vmin & vmax needs to be None if norm is passed
# TODO: always return a norm with vmin and vmax
Expand Down

0 comments on commit c9e4a41

Please sign in to comment.