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/788#issuecomment-195743394,https://api.github.com/repos/pydata/xarray/issues/788,195743394,MDEyOklzc3VlQ29tbWVudDE5NTc0MzM5NA==,10050469,2016-03-12T13:33:58Z,2016-03-12T13:33:58Z,MEMBER,"Hi @shoyer , here's an attempt: https://github.com/pydata/xarray/pull/794
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195672918,https://api.github.com/repos/pydata/xarray/issues/788,195672918,MDEyOklzc3VlQ29tbWVudDE5NTY3MjkxOA==,1217238,2016-03-12T06:44:17Z,2016-03-12T06:44:17Z,MEMBER,"Thanks @fmaussion for that example.
I would tentatively call this is a bug. At the very least, I don't think there's a good reason why this _shouldn't_ work.
I think we need a slightly more robust solution to these lines:
https://github.com/pydata/xarray/blob/v0.7.1/xarray/plot/plot.py#L380-L382
For example, it might be a better idea to look at `darray[xlab].dims` rather than `xlab` itself. Any interest in putting together a PR?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195563668,https://api.github.com/repos/pydata/xarray/issues/788,195563668,MDEyOklzc3VlQ29tbWVudDE5NTU2MzY2OA==,10050469,2016-03-11T21:33:06Z,2016-03-11T21:33:16Z,MEMBER,"Here is a mwe:
``` python
import xarray as xr
import numpy as np
temp = xr.DataArray(np.random.randn(3, 5),
dims=['time', 'x'],
coords={'x': [1,2,3,4,5],
'time': [1,2,3]})
temp.coords['rtime'] = temp.time + 3
# for some reason this works
temp.plot(x='x', y='rtime');
# this does not
temp.plot(x='rtime', y='x');
# and this works again
temp.T.plot(x='rtime', y='x');
```
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195520059,https://api.github.com/repos/pydata/xarray/issues/788,195520059,MDEyOklzc3VlQ29tbWVudDE5NTUyMDA1OQ==,10050469,2016-03-11T19:50:33Z,2016-03-11T19:50:33Z,MEMBER,"the question (I guess) is: is it legal in xarray to use a non-linked coordinate name as argument for a plot? For example @jamesp wants to plot the following DataArray:
``` python
...
Coordinates:
* x (x) int64 1 2 3 4 5
* time (time) int64 1 2 3
r int64 2
rtime (time) float64 0.5 1.0 1.5
```
By doing:
``` python
.plot(x='x', y='rtime');
```
instead of the more conventional:
``` python
.plot(x='x', y='time');
```
The dimension is still `time` but the coordinates of the plot (for the axis) is `rtime`. It works if you don't change the order of the dims, but it does not work if you do (hence the transpose in my workaround).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195503517,https://api.github.com/repos/pydata/xarray/issues/788,195503517,MDEyOklzc3VlQ29tbWVudDE5NTUwMzUxNw==,1217238,2016-03-11T19:12:07Z,2016-03-11T19:12:07Z,MEMBER,"To be clear, by ""Can you do this in pure matplotlib instead of xarray plotting?"", I meant could you please demonstrate that here so I can understand exactly what you were hoping to see? Bug reports that show what you expect are more useful than those that only show what went wrong :).
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195453265,https://api.github.com/repos/pydata/xarray/issues/788,195453265,MDEyOklzc3VlQ29tbWVudDE5NTQ1MzI2NQ==,1217238,2016-03-11T16:58:31Z,2016-03-11T16:58:31Z,MEMBER,"Honestly I'm a little surprised this doesn't error: `dat.temperature.sel(r=2).mean(’y’).plot(x=’x’, y=’rtime’)`. The plot from your PDF doesn't seem to have the right y labels (rtime ranges from 0 to 2, but the highest label on the plot is 1).
What would you expect these plots to look like? Can you do this in pure matplotlib instead of xarray plotting? I would guess the result you're looking for may be possible but it's not immediately obvious to me what plot _should_ result from this code.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-195001109,https://api.github.com/repos/pydata/xarray/issues/788,195001109,MDEyOklzc3VlQ29tbWVudDE5NTAwMTEwOQ==,10050469,2016-03-10T18:58:14Z,2016-03-10T18:58:14Z,MEMBER,"I think that the first case works by chance, since the data dimensions are still 'time', 'x'. But this workaround should work:
``` python
dat.temperature.sel(r=2).mean('y').T.plot(x='rtime', y='x')
```
(note the transpose)
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-194886681,https://api.github.com/repos/pydata/xarray/issues/788,194886681,MDEyOklzc3VlQ29tbWVudDE5NDg4NjY4MQ==,10050469,2016-03-10T14:55:14Z,2016-03-10T14:55:14Z,MEMBER,"I guess that what you are asking is that `xarray` should infer from y='x' that the other dimension _must_ be time, and then scale with your new `rtime` coordinates?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-194885374,https://api.github.com/repos/pydata/xarray/issues/788,194885374,MDEyOklzc3VlQ29tbWVudDE5NDg4NTM3NA==,10050469,2016-03-10T14:53:18Z,2016-03-10T14:53:18Z,MEMBER,"Aha, I think I just got it. I deleted my previous answer, as I don't know how to answer your question
:flushed:
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868
https://github.com/pydata/xarray/issues/788#issuecomment-194835067,https://api.github.com/repos/pydata/xarray/issues/788,194835067,MDEyOklzc3VlQ29tbWVudDE5NDgzNTA2Nw==,10050469,2016-03-10T13:11:13Z,2016-03-10T13:11:13Z,MEMBER,"Just out of curiosity, what is the use case here? In your example the coordinate `rtime` has a shape `(time: 3, r: 3)` ant it is not linked to any dimension of the variable that you are plotting. What do you expect the plot to do?
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,139863868