issues: 1340669247
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1340669247 | I_kwDOAMm_X85P6P0_ | 6922 | Support for matplotlib mosaic using variable names | 5797727 | open | 0 | 1 | 2022-08-16T17:31:23Z | 2022-08-17T05:35:39Z | NONE | Is your feature request related to a problem?This is not related to any problem, but I think it would be nice to have a support for giving a Describe the solution you'd likeSomething like ```python import matplotlib.pyplot as plt import xarray as xr import numpy as np n = 200 t = np.linspace(0,32np.pi,n) ds = xr.Dataset({letter:(("s","t"),np.sin(t)+0.5*np.random.randn(3,n)) for letter in "A B C D E".split()}) ds = ds.assign_coords(t=t,s=range(3)) mosaic = [ ["A","A","B","B","C","C"], ["X","D","D","E","E","X"], ] kw = dict(x="t",hue="s",add_legend=False) ds.plot.line(mosaic=mosaic,empty_sentinel="X",**kw) ```
Describe alternatives you've consideredI have a code snippet that generate similar results but with more code. ```python import matplotlib.pyplot as plt import xarray as xr import numpy as np n = 200 t = np.linspace(0,32np.pi,n) ds = xr.Dataset({letter:(("s","t"),np.sin(t)+0.5*np.random.randn(3,n)) for letter in "A B C D E".split()}) ds = ds.assign_coords(t=t,s=range(3)) mosaic = [ ["A","A","B","B","C","C"], ["X","D","D","E","E","X"], ] kw = dict(x="t",hue="s",add_legend=False) fig = plt.figure(constrained_layout=True,figsize=(8,4)) ax = fig.subplot_mosaic(mosaic,empty_sentinel="X") for key in ds: ds[key].plot.line(ax=ax[key],**kw) ``` Additional contextNo response |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/6922/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |