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/pull/4820#issuecomment-778596102,https://api.github.com/repos/pydata/xarray/issues/4820,778596102,MDEyOklzc3VlQ29tbWVudDc3ODU5NjEwMg==,14371165,2021-02-13T10:25:13Z,2021-02-13T10:25:13Z,MEMBER,"I think this is ready now. I'm not super happy with the docs, I think copying makes sense but it doesn't match completely at the moment. I was thinking that can be solved by rewriting the dataarray version in a smarter way.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787732195 https://github.com/pydata/xarray/pull/4820#issuecomment-775390720,https://api.github.com/repos/pydata/xarray/issues/4820,775390720,MDEyOklzc3VlQ29tbWVudDc3NTM5MDcyMA==,14371165,2021-02-08T19:34:46Z,2021-02-08T19:35:57Z,MEMBER,"I think making the dataset plots a thin wrapper for the dataarray plot functions is the way to go. I think most things for the lineplot works as intended now. I'm not sure about the decorator though. It's a bit too simple compared to _dsplot at the moment. Supporting linewidth in plots should be possible but this is for a future pr I think. I did a small proof of concept here: ```python def _lineplot(ds, x, y, hue, linewidth): if len(ds[y].dims) > 3: raise NotImplementedError(""too many dims."") fig, ax = plt.subplots(1, 1) for i, width in enumerate(ds[linewidth]): # Filter along linewidth: dsi = ds.isel(**{linewidth: i}) # Values to plot: xplt = dsi[x] # if xplt has no dims: (xdim,) = xplt.dims (huedim,) = dsi[hue].dims yplt = dsi[y].transpose(..., xdim, huedim) # Set plot properties: len_lines = len(ds[hue]) cmap = plt.get_cmap(""viridis"", len_lines) colors = plt.cycler(color=cmap(np.arange(len_lines))) lw = plt.cycler(lw=[1 + i * 3]) ax.set_prop_cycle(colors * lw) # p = xr.broadcast(xplt, yplt) plt.plot(xplt, yplt, label=width.values) plt.legend() # ax.plot doesn't return a mappable that fig.colorbar can parse. Create # one and return that one instead: norm = plt.Normalize(vmin=ds[hue].min(), vmax=ds[hue].max()) primitive = plt.cm.ScalarMappable(cmap=plt.get_cmap(""viridis""), norm=norm) fig.colorbar(mappable=primitive) return fig, ax ds = xr.tutorial.scatter_example_dataset() ds1 = ds.sel(z=0) _lineplot(ds=ds1, x=""y"", y=""A"", hue=""w"", linewidth=""x"") ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787732195 https://github.com/pydata/xarray/pull/4820#issuecomment-767765210,https://api.github.com/repos/pydata/xarray/issues/4820,767765210,MDEyOklzc3VlQ29tbWVudDc2Nzc2NTIxMA==,14371165,2021-01-26T19:12:16Z,2021-01-26T19:12:16Z,MEMBER,"Added a variant using dataarray, it's much cleaner although the wrappers had to be redone. I think we can move `ds.plot.scatter` to the dataarray side as well.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787732195 https://github.com/pydata/xarray/pull/4820#issuecomment-766095911,https://api.github.com/repos/pydata/xarray/issues/4820,766095911,MDEyOklzc3VlQ29tbWVudDc2NjA5NTkxMQ==,14371165,2021-01-23T15:26:42Z,2021-01-23T15:26:42Z,MEMBER,"I've added a little todo list of things I've noticed, @mathause. Did you have something else in mind? I wouldn't mind some more examples and matplotlib solutions if anyone has done any nice looking line plots with xarray before.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,787732195