You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed pint-xarray converts to the desired units but along the way it loses the units attribute. I can see in the html repr it keeps track of the unit within the Quantity. Is it worth keeping a copy in the attrs as well as these are in used in plotting?
thanks for the issue, @raybellwaves. Keeping the units in the attributes is difficult because it would have to be synchronized with the units on the data, and most operations in xarray don't have hooks for that.
For now, the best workaround is to dequantify immediately before calling the plotting functions. In the future, I hope that we can just have this work automatically (you set the default format: ureg.default_format = "~P" (or pint-xarray does set a good default) and the matplotlib.units functionality does the rest). However, that currently doesn't work because xarray's plotting functions convert to ndarray (see #91 for the issue).
I noticed pint-xarray converts to the desired units but along the way it loses the units attribute. I can see in the html repr it keeps track of the unit within the Quantity. Is it worth keeping a copy in the attrs as well as these are in used in plotting?
Desired:
The text was updated successfully, but these errors were encountered: