html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4322#issuecomment-735282792,https://api.github.com/repos/pydata/xarray/issues/4322,735282792,MDEyOklzc3VlQ29tbWVudDczNTI4Mjc5Mg==,2448579,2020-11-28T19:51:31Z,2020-11-28T19:51:31Z,MEMBER,Yes I think something like this (though ugly) will be necessary.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,675288247 https://github.com/pydata/xarray/issues/4322#issuecomment-734488917,https://api.github.com/repos/pydata/xarray/issues/4322,734488917,MDEyOklzc3VlQ29tbWVudDczNDQ4ODkxNw==,14808389,2020-11-26T21:51:03Z,2020-11-26T21:51:03Z,MEMBER,"if I understand correctly, this happens here: https://github.com/pydata/xarray/blob/5883a460b8fa9a72a2f12ee6495665bb7cc304f6/xarray/plot/plot.py#L295-L300 where `xlabel` and `ylabel` are extracted from `xplt` and `yplt` using `label_from_attrs`. In `_resolve_intervals_1dplot` `xlabel` and `ylabel` simply get the `_center` suffix, it is not used for anything else. Wouldn't it be possible to modify the calls of `_infer_line_data` and `_resolve_intervals_1dplot` to something like this: ```python xplt, yplt, hueplt, hue_label = _infer_line_data(darray, x, y, hue) # Remove pd.Intervals if contained in xplt.values and/or yplt.values. xplt_val, yplt_val, x_suffix, y_suffix, kwargs = _resolve_intervals_1dplot( xplt.values, yplt.values, kwargs ) xlabel = label_from_attrs(xplt, extra=x_suffix) ylabel = label_from_attrs(yplt, extra=y_suffix) ``` and then have `_resolve_intervals_1dplot` return either `""_center""` or `""""` as `x_suffix` and `y_suffix`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,675288247 https://github.com/pydata/xarray/issues/4322#issuecomment-670764550,https://api.github.com/repos/pydata/xarray/issues/4322,670764550,MDEyOklzc3VlQ29tbWVudDY3MDc2NDU1MA==,2448579,2020-08-07T22:28:27Z,2020-08-07T22:28:27Z,MEMBER,"Oh sorry I misunderstood that bit. Yes, that looks like a bug. A PR would be welcome. I guess you should add a suffix kwarg to the `plot.utils.label_from_attrs` function.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,675288247 https://github.com/pydata/xarray/issues/4322#issuecomment-670757610,https://api.github.com/repos/pydata/xarray/issues/4322,670757610,MDEyOklzc3VlQ29tbWVudDY3MDc1NzYxMA==,23484003,2020-08-07T22:23:24Z,2020-08-07T22:23:24Z,NONE,"@dcherian: OK, thanks, now I understand why it is happening -- there's no unambiguous way to represent the intervals as floats, so one needs to use either the left/right/midpoint & indicate that. For my case, I think I will just replace the array of intervals with the array of midpoints of the intervals. The ""_center"" tag still doesn't work with the automatic units labeling though: ``` import xarray as xr import numpy as np data_vars={'y':('x',np.ones((101)),{'units':'kg/m'})} coords={'x':('x',np.linspace(0,1,101,endpoint=True),{'units':'m'})} ds = xr.Dataset(data_vars,coords) dsd = ds.groupby_bins('x',np.linspace(0,1,11,endpoint=True),right=False).sum(dim='x') dsd.x_bins.attrs = dsd.x_bins.attrs dsd.y.plot() #The x-axis label still looks like ""x [m]_center"" ``` The ""_center"" tag should be applied before the ""[m]"" one.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,675288247 https://github.com/pydata/xarray/issues/4322#issuecomment-670721702,https://api.github.com/repos/pydata/xarray/issues/4322,670721702,MDEyOklzc3VlQ29tbWVudDY3MDcyMTcwMg==,2448579,2020-08-07T21:32:53Z,2020-08-07T21:32:53Z,MEMBER,"This is because `x_bins` contains interval objects. `.plot` is calculating the center of the interval and letting you know that it is doing so. If you want that line plot please use `ax.set_xlabel`, otheriwse try `.plot.step` which will more faithfully represent the intervals with label `x_bins`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,675288247