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/4235#issuecomment-1100953854,https://api.github.com/repos/pydata/xarray/issues/4235,1100953854,IC_kwDOAMm_X85Bnzj-,26384082,2022-04-17T21:43:44Z,2022-04-17T21:43:44Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity
If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,659142025
https://github.com/pydata/xarray/issues/4235#issuecomment-663157223,https://api.github.com/repos/pydata/xarray/issues/4235,663157223,MDEyOklzc3VlQ29tbWVudDY2MzE1NzIyMw==,8419157,2020-07-23T18:15:33Z,2020-07-23T18:18:24Z,NONE,"To give a bit more context, an example code simulating an experimental measurement.
```
import numpy as np
import xarray as xr
from scipy.stats import norm
from matplotlib import pyplot as plt
# nominal x
x = xr.DataArray(np.arange(-10, 10, 0.1), dims='index', name='x')
# Shift loc
loc = xr.DataArray(np.arange(-0.5, 1, 0.5), dims='loc', name='loc')
# Number of experiments
exp = xr.DataArray(range(3), dims='exp', name='exp')
# Add noise to x per experiment
noise = xr.DataArray(np.random.rand(len(x), len(loc)),
coords={'loc': loc},
dims=['index', 'loc'])
x = x + noise * 0.5
# Measure
y = xr.apply_ufunc(
norm.pdf, x, x['loc'], 1,
input_core_dims=[['index'], [], []],
output_core_dims=[['index']],
vectorize=True
)
# Name
x.name = 'x'
y.name = 'y'
# Merge
data = xr.merge([x, y])
```
I wish to be able to use this
```
# Plot y against x
data.plot.line(x='x', y='y', hue='loc')
```
However, the closest I could get is with only `y`
```
y.plot.line(x='index', hue='loc')
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,659142025
https://github.com/pydata/xarray/issues/4235#issuecomment-660595722,https://api.github.com/repos/pydata/xarray/issues/4235,660595722,MDEyOklzc3VlQ29tbWVudDY2MDU5NTcyMg==,6164157,2020-07-19T06:25:27Z,2020-07-19T06:25:27Z,CONTRIBUTOR,Sounds good. Just to mention that it might be easy to implement by stacking the arrays using `.to_array` and then just using `DataArray.plot.line`.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,659142025
https://github.com/pydata/xarray/issues/4235#issuecomment-660201329,https://api.github.com/repos/pydata/xarray/issues/4235,660201329,MDEyOklzc3VlQ29tbWVudDY2MDIwMTMyOQ==,10194086,2020-07-17T16:21:30Z,2020-07-17T16:21:30Z,MEMBER,"To be sure - you want to get the x-values from one DataArray and the y-values from another? Similarly to http://xarray.pydata.org/en/stable/plotting.html#datasets but drawing lines instead of scatterpoints?
Sounds reasonable but may be a bit more difficult than `scatter` because you cannot just flatten your array (I think):
https://github.com/pydata/xarray/blob/1be777fe725a85b8cc0f65a2bc41f4bc2ba18043/xarray/plot/dataset_plot.py#L435-L437","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,659142025
https://github.com/pydata/xarray/issues/4235#issuecomment-660187478,https://api.github.com/repos/pydata/xarray/issues/4235,660187478,MDEyOklzc3VlQ29tbWVudDY2MDE4NzQ3OA==,2448579,2020-07-17T15:58:34Z,2020-07-17T15:58:34Z,MEMBER,"Sounds good to me.
cc @mathause @yohai ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,659142025