Skip to content

Commit

Permalink
Add units if "unit" is in the attrs. (#4850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan authored Jan 30, 2021
1 parent 39048f9 commit 5735e16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xarray/plot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ def label_from_attrs(da, extra=""):

if da.attrs.get("units"):
units = " [{}]".format(da.attrs["units"])
elif da.attrs.get("unit"):
units = " [{}]".format(da.attrs["unit"])
else:
units = ""

Expand Down

0 comments on commit 5735e16

Please sign in to comment.