Skip to content
forked from pydata/xarray

Commit 5735e16

Browse files
authored
Add units if "unit" is in the attrs. (pydata#4850)
1 parent 39048f9 commit 5735e16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xarray/plot/utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ def label_from_attrs(da, extra=""):
460460

461461
if da.attrs.get("units"):
462462
units = " [{}]".format(da.attrs["units"])
463+
elif da.attrs.get("unit"):
464+
units = " [{}]".format(da.attrs["unit"])
463465
else:
464466
units = ""
465467

0 commit comments

Comments
 (0)