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
415209776,MDU6SXNzdWU0MTUyMDk3NzY=,2791,formatting of singleton DataArrays,6164157,closed,0,,,8,2019-02-27T16:22:34Z,2023-12-02T02:44:06Z,2023-12-02T02:44:05Z,CONTRIBUTOR,,,,"#### Code Sample, a copy-pastable example if possible
```python
a=xr.DataArray(1.234)
'{:1.3f}'.format(a) # throws error
'{:1.3f}'.format(a.values) # behaves nicely
```
#### Problem description
I think it would be useful for `repr(a)` to return `repr(a.values)` when `a.ndim==0` and perhaps also when `a.size==1`. For example, this would make such code work:
```python
a=xr.DataArray(range(4))
' '.join('{:d}'.format(v) for v in a)
```
while currently one has to write
```python
' '.join('{:d}'.format(v.values) for v in a)
```
I tried to think whether this will break something else but I couldn't think of anything.
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2791/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
320632674,MDExOlB1bGxSZXF1ZXN0MTg2MjI4NjMz,2107,ENH: added FacetGrid functionality to line plots,6164157,closed,0,,,14,2018-05-06T21:56:54Z,2022-11-16T14:36:56Z,2018-06-04T15:54:45Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2107," closes #2084
a) plot.line can now accept also 'row' and 'col' keywords.
b) If 'hue' is passed as a keyword to DataArray.plot() it generates
a line plot FacetGrid.
c) Line plots are automatically generated if the number of dimensions
after faceting along row and/or col is one.
- [x] Closes #xxxx (remove if there is no corresponding issue, which should only be the case for minor changes)
- [x] Tests added (for all bug fixes or enhancements)
- [x] Tests passed (for all non-documentation changes)
- [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later)
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2107/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
462049420,MDExOlB1bGxSZXF1ZXN0MjkyODQyOTg5,3054,Flat iteration over DataArray,6164157,closed,0,,,6,2019-06-28T14:00:24Z,2021-06-17T16:16:50Z,2021-06-17T16:16:50Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3054," - [ ] Tests added
- [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
A very simple way to iterate over `DataArray`s, imitating numpy's flat iterator.
For a DataArray `da`, I implemented a flat iterator that works exactly like `da.values.flat`, but returns a singelton `DataArray` that has all the coordinates and meta data and whatnot.
I wrote it because I needed it for something and thought it would be useful for others too. I'd love to hear your opinions - if you think it's useful I'll write up some unittests. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3054/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
633516123,MDU6SXNzdWU2MzM1MTYxMjM=,4126,Bug in legend of dataset.plot.scatter,6164157,closed,0,,,3,2020-06-07T15:38:46Z,2020-09-13T08:33:15Z,2020-09-10T18:48:11Z,CONTRIBUTOR,,,,"
When using Dataset.scatter with hue being a variable of dtype string, the legend turns out to be wrong.
#### MCVE Code Sample
```python
import xarray as xr
import numpy as np
dd = xr.Dataset({'y': (['x'], np.arange(8)),
'label': (['x'], list('AABBCCDD'))},
coords={'x': np.linspace(0,1,8)})
dd.plot.scatter(x='x', y='y', hue='label')
```
Output is (note the legend):

Playing around it seems that it always chooses the first 4 values as the legend labels (note that the order of colors of the points is correct):
```python
import xarray as xr
import numpy as np
dd = xr.Dataset({'y': (['x'], np.arange(8)),
'label': (['x'], list('ABBACDDC'))},
coords={'x': np.linspace(0,1,8)})
dd.plot.scatter(x='x', y='y', hue='label')
```

And if there are only 3 labels in total it chooses the first 3:
```python
import xarray as xr
import numpy as np
dd = xr.Dataset({'y': (['x'], np.arange(6)),
'label': (['x'], list('ABBACC'))},
coords={'x': np.linspace(0,1,6)})
dd.plot.scatter(x='x', y='y', hue='label')
```

#### Expected Output
Legend in first two plots should read 'ABCD' and last plot 'ABC'
#### Versions
Output of xr.show_versions()
INSTALLED VERSIONS
------------------
commit: None
libhdf5: 1.10.4
libnetcdf: None
xarray: 0.15.1
pandas: 0.25.1
numpy: 1.17.2
scipy: 1.3.1
netCDF4: None
pydap: None
h5netcdf: None
h5py: 2.9.0
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.1
dask: 2.5.2
distributed: 2.5.2
matplotlib: 3.1.1
cartopy: None
seaborn: 0.9.0
numbagg: None
setuptools: 41.4.0
pip: 19.2.3
conda: 4.8.1
pytest: 5.2.1
IPython: 7.8.0
sphinx: 2.2.0
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4126/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
648047992,MDExOlB1bGxSZXF1ZXN0NDQxOTIzODMx,4188,Fix typo in error message in plot.py,6164157,closed,0,,,1,2020-06-30T10:08:26Z,2020-06-30T11:35:21Z,2020-06-30T11:35:21Z,CONTRIBUTOR,,0,pydata/xarray/pulls/4188,Fix typo in error message in plot.py,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/4188/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
545624732,MDExOlB1bGxSZXF1ZXN0MzU5NDU5Njcy,3663,Typo in Universal Functions section,6164157,closed,0,,,1,2020-01-06T09:22:25Z,2020-01-06T11:41:51Z,2020-01-06T11:41:42Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3663,"
- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Passes `black . && mypy . && flake8`
- [ ] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3663/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
340069538,MDExOlB1bGxSZXF1ZXN0MjAwNTcxMjI1,2277,ENH: Scatter plots of one variable vs another,6164157,closed,0,,,45,2018-07-11T02:31:01Z,2019-08-08T18:05:00Z,2019-08-08T15:57:17Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2277," - [x] Closes #470
- [x] Tests added (for all bug fixes or enhancements)
- [x] Tests passed (for all non-documentation changes)
- [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
- [x] Add support for `size`?
- [x] Revert hue=datetime support bits
Say you have two variables in a `Dataset` and you want to make a scatter plot of one vs the other, possibly using different hues and/or faceting. This is useful if you want to inspect the data to see whether two variables have some underlying relationships between them that you might have missed. It's something that I found myself manually writing the code for quite a few times, so I thought it would be better to have it as a feature. I'm not sure if this is actually useful for other people, but I have the feeling that it probably is.
First, set up dataset with two variables:
```python
import xarray as xr
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
A = xr.DataArray(np.zeros([3, 11, 4, 4]), dims=[ 'x', 'y', 'z', 'w'],
coords=[np.arange(3), np.linspace(0,1,11), np.arange(4), 0.1*np.random.randn(4)])
B = 0.1*A.x**2+A.y**2.5+0.1*A.z*A.w
A = -0.1*A.x+A.y/(5+A.z)+A.w
ds = xr.Dataset({'A':A, 'B':B})
ds['w'] = ['one', 'two', 'three', 'five']
```
Now, we can plot all values of `A` vs all values of `B`:
```python
plt.plot(A.values.flat,B.values.flat,'.')
```

What a mess. Wouldn't it be nice if you could color each point according to the value of some coordinate, say `w`?
```python
ds.scatter(x='A',y='B', hue='w')
```

Huh! There seems to be some underlying structure there. Can we also facet over a different coordinate?
```python
ds.scatter(x='A',y='B',col='x', hue='w')
```

or two coordinates?
```python
ds.scatter(x='A',y='B',col='x', row='z', hue='w')
```

The logic is that dimensions that are not faceted/hue are just stacked using `xr.stack` and plotted. Only variables that have exactly the same dimensions are allowed.
Regarding implementation -- I am certainly not sure about the API and I probably haven't thought about edge cases with missing data or nans or whatnot, so any input would be welcome. Also, there might be a simpler implementation by first using `to_array` and then using existing line plot functions, but I couldn't find it. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2277/reactions"", ""total_count"": 3, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 3, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
460960338,MDExOlB1bGxSZXF1ZXN0MjkxOTgwNTUz,3046,typo in whats-new,6164157,closed,0,,,1,2019-06-26T13:07:47Z,2019-06-26T16:29:15Z,2019-06-26T15:35:52Z,CONTRIBUTOR,,0,pydata/xarray/pulls/3046,Small typo.,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3046/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
409305872,MDExOlB1bGxSZXF1ZXN0MjUyMzIwNTA4,2763,typo in whats_new,6164157,closed,0,,,1,2019-02-12T13:44:42Z,2019-02-12T17:41:54Z,2019-02-12T17:41:54Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2763,just a small typo,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2763/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
407523050,MDExOlB1bGxSZXF1ZXN0MjUwOTc4NzU1,2749,Fix name loss when masking,6164157,closed,0,,,5,2019-02-07T02:59:45Z,2019-02-12T01:46:51Z,2019-02-11T17:35:03Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2749,"
- [x] Closes #2457 #2748
- [x] Tests added
- [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API
I took a simple-minded strategy to fix: just mask and then rename the result to `self.name`. This is a slight overkill since the renaming will be done on every masking, not just on the edge cases when it's needed, but this is really a very small computational cost and it's much easier and bulletproof.","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2749/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
407085814,MDU6SXNzdWU0MDcwODU4MTQ=,2748,Inconsistent name behavior in masking,6164157,closed,0,,,2,2019-02-06T05:25:47Z,2019-02-11T19:05:40Z,2019-02-11T19:05:40Z,CONTRIBUTOR,,,,"#### Code Sample, a copy-pastable example if possible
Consider the following 4 ways to mask an `DataArray`:
```python
import xarray as xr
ds=xr.Dataset({'a': (['x'], range(10))},
coords={'x': range(10)})
ds['msk']=ds.a>5
msk=ds.a>5
v1=ds.a.where(ds.a>5)
v2=ds.a.where(msk)
v3=ds.where(ds.msk).a
v4=ds.a.where(ds.msk)
', '.join(str(v.name) for v in (v1, v2, v3, v4))```
#output:
'a, a, a, None'
```
#### Problem description
All `v`s defined above are identical, except that `v4` has lost its name in masking. This can cause errors in merging (like just happened to me and was hard and annoying to catch).
Is this behavior intentional? It seems inconsistent to me that `ds.a.where(ds.msk)` is not equivalent to `ds.where(ds.msk).a`
#### Expected Output
I would expect `ds.a.where(ds.msk)` to return a `DataArray` with the name `a`.
#### Output of ``xr.show_versions()``
INSTALLED VERSIONS
------------------
commit: None
python: 3.7.2 (default, Dec 29 2018, 00:00:04)
[Clang 4.0.1 (tags/RELEASE_401/final)]
python-bits: 64
OS: Darwin
OS-release: 18.2.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: None
libnetcdf: None
xarray: 0.11.1+49.g27cf53f2
pandas: 0.23.3
numpy: 1.16.0
scipy: 1.2.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.2.0
cftime: 1.0.3.4
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.1
cyordereddict: None
dask: 1.1.0
distributed: 1.25.3
matplotlib: 3.0.2
cartopy: 0.17.0
seaborn: 0.9.0
setuptools: 40.8.0
pip: 19.0.1
conda: None
pytest: None
IPython: 7.2.0
sphinx: 1.8.2
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2748/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
406615454,MDU6SXNzdWU0MDY2MTU0NTQ=,2743,Documentation fails to build,6164157,closed,0,,,5,2019-02-05T03:27:14Z,2019-02-06T16:56:48Z,2019-02-06T16:56:48Z,CONTRIBUTOR,,,,"I'm trying to build the doc and it fails. I have a fresh miniconda install with a test environment created as instructed in the docs (i.e. `conda env create -f ci/requirements-py36.yml` followed by `conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc`).
#### Code Sample, a copy-pastable example if possible
```shell
make clean
make html
```
#### Problem description
It generates the following error:
```
Exception occurred:
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_directive.py"", line 567, in process_input
raise RuntimeError('Non Expected exception in `{}` line {}'.format(filename, lineno))
RuntimeError: Non Expected exception in `/Users/yohai/Dropbox/Coding/xarray/doc/io.rst` line 376
The full traceback has been saved in /var/folders/mj/g9tnmysj6zld_3dg6hm9tkk00000gn/T/sphinx-err-8q55qmxi.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at . Thanks!
make: *** [html] Error 2
```
The problem seems to be in `doc/io.rst`. When I delete all lines upto [line 367](https://github.com/pydata/xarray/blame/master/doc/io.rst#L367) it builds well
The content of the traceback logfile:
```
# Sphinx version: 1.8.4
# Python version: 3.6.7 (CPython)
# Docutils version: 0.14
# Jinja2 version: 2.10
# Last messages:
# reading sources... [ 97%] indexing
#
# reading sources... [ 97%] installing
#
# reading sources... [ 97%] internals
#
# reading sources... [ 97%] interpolation
#
# reading sources... [ 98%] io
#
# Loaded extensions:
# sphinx.ext.mathjax (1.8.4) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/ext/mathjax.py
# alabaster (0.7.12) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/alabaster/__init__.py
# sphinx.ext.autodoc (1.8.4) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py
# sphinx.ext.autosummary (1.8.4) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/ext/autosummary/__init__.py
# sphinx.ext.intersphinx (1.8.4) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/ext/intersphinx.py
# sphinx.ext.extlinks (1.8.4) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/ext/extlinks.py
# numpydoc (0.8.0) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/numpydoc/__init__.py
# IPython.sphinxext.ipython_directive (unknown version) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_directive.py
# IPython.sphinxext.ipython_console_highlighting (unknown version) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_console_highlighting.py
# sphinx_gallery.gen_gallery (0.2.0) from /Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx_gallery/gen_gallery.py
Traceback (most recent call last):
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/cmd/build.py"", line 304, in build_main
app.build(args.force_all, filenames)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/application.py"", line 341, in build
self.builder.build_update()
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/builders/__init__.py"", line 347, in build_update
len(to_build))
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/builders/__init__.py"", line 360, in build
updated_docnames = set(self.read())
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/builders/__init__.py"", line 468, in read
self._read_serial(docnames)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/builders/__init__.py"", line 490, in _read_serial
self.read_doc(docname)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/builders/__init__.py"", line 534, in read_doc
doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/io.py"", line 318, in read_doc
pub.publish()
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/core.py"", line 217, in publish
self.settings)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/readers/__init__.py"", line 72, in read
self.parse()
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/readers/__init__.py"", line 78, in parse
self.parser.parse(self.input, document)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/sphinx/parsers.py"", line 88, in parse
self.statemachine.run(inputstring, document, inliner=self.inliner)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 171, in run
input_source=document['source'])
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 239, in run
context, state, transitions)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 460, in check_line
return method(match, context, next_state)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2753, in underline
self.section(title, source, style, lineno - 1, messages)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 327, in section
self.new_subsection(title, lineno, messages)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 395, in new_subsection
node=section_node, match_titles=True)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 282, in nested_parse
node=node, match_titles=match_titles)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 239, in run
context, state, transitions)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 460, in check_line
return method(match, context, next_state)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2753, in underline
self.section(title, source, style, lineno - 1, messages)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 327, in section
self.new_subsection(title, lineno, messages)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 395, in new_subsection
node=section_node, match_titles=True)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 282, in nested_parse
node=node, match_titles=match_titles)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 239, in run
context, state, transitions)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/statemachine.py"", line 460, in check_line
return method(match, context, next_state)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2326, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2338, in explicit_construct
return method(self, expmatch)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2081, in directive
directive_class, match, type_name, option_presets)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/docutils/parsers/rst/states.py"", line 2130, in run_directive
result = directive_instance.run()
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_directive.py"", line 1005, in run
rows, figure = self.shell.process_block(block)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_directive.py"", line 711, in process_block
self.process_input(data, input_prompt, lineno)
File ""/Users/yohai/miniconda3/envs/test_env/lib/python3.6/site-packages/IPython/sphinxext/ipython_directive.py"", line 567, in process_input
raise RuntimeError('Non Expected exception in `{}` line {}'.format(filename, lineno))
RuntimeError: Non Expected exception in `/Users/yohai/Dropbox/Coding/xarray/doc/io.rst` line 376
```
#### Output of ``xr.show_versions()``
xr.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.7 | packaged by conda-forge | (default, Nov 20 2018, 18:37:09)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
python-bits: 64
OS: Darwin
OS-release: 18.2.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.4
libnetcdf: 4.6.2
xarray: 0.11.1+49.g27cf53f2
pandas: 0.24.1
numpy: 1.15.4
scipy: 1.2.0
netCDF4: 1.4.2
pydap: installed
h5netcdf: 0.6.2
h5py: 2.9.0
Nio: None
zarr: 2.2.0
cftime: 1.0.3.4
PseudonetCDF: None
rasterio: 1.0.15
cfgrib: 0.9.5.5
iris: None
bottleneck: 1.2.1
cyordereddict: None
dask: 1.1.1
distributed: 1.25.3
matplotlib: 3.0.2
cartopy: 0.17.0
seaborn: 0.9.0
setuptools: 40.7.1
pip: 19.0.1
conda: None
pytest: 4.2.0
IPython: 7.2.0
sphinx: 1.8.4
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2743/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
337015273,MDExOlB1bGxSZXF1ZXN0MTk4MzMwMTUx,2259,BUG: unnamed args in faceted line plots,6164157,closed,0,,,1,2018-06-29T14:14:02Z,2019-02-05T15:52:42Z,2018-07-04T17:06:55Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2259,"- [x] Closes #2248 (remove if there is no corresponding issue, which should only be the case for minor changes)
- [x] Tests added (for all bug fixes or enhancements)
- [x] Tests passed (for all non-documentation changes)
Fixed a syntax inconsistency, allowing to pass unnamed arguments to faceted line plots.
Example code:
```python
import xarray as xr
import numpy as np
np.random.seed(0)
da = xr.DataArray(np.random.randn(3, 3, 3, 3),
dims=['x', 'y', 'z', 'w'],
coords=[range(3), [3.5, 4.9, 6.7], ['a','b','c'], ['foo', 'bar', 'foobar']],
name='arr_name')
da.plot.line('o--',row='y', col='w',hue='z')
```

","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2259/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
342061692,MDExOlB1bGxSZXF1ZXN0MjAyMDUxNDcy,2296,DOC: replace broken link by a link to @shoyer's personal blog,6164157,closed,0,,,1,2018-07-17T19:55:21Z,2018-07-17T20:01:34Z,2018-07-17T20:01:28Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2296,"Closes #2295 (remove if there is no corresponding issue, which should only be the case for minor changes)
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2296/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
342005194,MDU6SXNzdWUzNDIwMDUxOTQ=,2295,Broken link in doc,6164157,closed,0,,,1,2018-07-17T17:02:18Z,2018-07-17T20:01:28Z,2018-07-17T20:01:28Z,CONTRIBUTOR,,,,"The link to the external blogpost about xarray and dask, that was fixed in https://github.com/pydata/xarray/pull/1573, is broken again. Is it available somewhere?
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2295/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
335123398,MDU6SXNzdWUzMzUxMjMzOTg=,2248,unnamed args in faceted line plots,6164157,closed,0,,,0,2018-06-23T19:02:17Z,2018-07-04T17:06:55Z,2018-07-04T17:06:54Z,CONTRIBUTOR,,,,"#### Code Sample, a copy-pastable example if possible
Unnamed arguments that are passed to line plots are directly passed to `plot`.
```python
import xarray as xr
import numpy as np
d3 = xr.DataArray(np.random.randn(10, 6, 3),
dims=['x', 'y', 'z'],
coords=[range(10), range(6), ['foo', 'bar', 'foobar']])
d2 = d3[..., 0].squeeze(drop=True)
# This will make triangle markers and dashed lines:
d2.plot.line('^--',x='x')
```
We [recently implemented ](https://github.com/pydata/xarray/pull/2107) faceted line plots:
```python
d3.plot(col='z', hue='x') #should work from commit `bc52f8a` onwards.
```
However, current implementation does not allow for passing of unnamed arguments:
```python
d3.plot('^--', col='z', hue='x') #gives error
d3.plot.line('^--', col='z', hue='x') #gives different error
```
I'd be happy to fix this (it's probably an easy fix, I didn't check) but I'm not sure what the correct user interface should be. Should `DataArray.plot` with `hue` as a keyword behave identically to `DataArray.plot.line`? ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2248/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue
336999871,MDExOlB1bGxSZXF1ZXN0MTk4MzE4MTQ5,2258,BUG: unnamed args in faceted line plots,6164157,closed,0,,,1,2018-06-29T13:30:54Z,2018-06-29T14:00:47Z,2018-06-29T13:59:12Z,CONTRIBUTOR,,0,pydata/xarray/pulls/2258," - [x] Closes #2248 (remove if there is no corresponding issue, which should only be the case for minor changes)
- [x] Tests added (for all bug fixes or enhancements)
- [x] Tests passed (for all non-documentation changes)
Fixed a syntax inconsistency, allowing to pass unnamed arguments to faceted line plots.
```python
Example code:
import xarray as xr
import numpy as np
np.random.seed(0)
da = xr.DataArray(np.random.randn(3, 3, 3, 3),
dims=['x', 'y', 'z', 'w'],
coords=[range(3), [3.5, 4.9, 6.7], ['a','b','c'], ['foo', 'bar', 'foobar']],
name='arr_name')
da.plot.line('o--',row='y', col='w',hue='z')
```

","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2258/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull
317853953,MDU6SXNzdWUzMTc4NTM5NTM=,2084,New Feature: Add FacetGrid functionality to plot.line(),6164157,closed,0,,,5,2018-04-26T02:18:41Z,2018-06-15T05:13:40Z,2018-06-15T05:13:40Z,CONTRIBUTOR,,,,"When data is more than 2 dimensional, `plot()` creates a `FacetGrid` where each facet gets plots two dimensional data. I would find it very useful to have similar functionality for line plots.
Let's define three `DataArray`s, of 2,3 and 4 dimensions, named `d2`, `d3` and `d4`.
```python
d4=xr.DataArray(np.random.randn(3,4,5,6),
dims=['x','y','z','w'],
coords=[range(3),range(4),range(5),range(6)])
d3=d4[...,0].drop('w')
d2=d3[...,0].drop('z')
d4.plot(row='x', col='y') #creates a 2d facet grid, each facet is a pcolormesh
d3.plot(col='x') #creates a 1d facet grid, each facet is a pcolormesh
plt.show()
```
It would be very useful to have a similar interface for `line` plots too. That is, I would expect
```python
d2.plot.line(row='y', x='x')
```
to create a row of panels, each having one line. Similarly, I would expect
```python
d3.plot.line(col='y', x='x')
#or alternatively
d3.plot.line(col='y', hue='z')
```
to create a row of panels, each having a series of lines, with `hue` corresponding to `z` and so forth. Finally,
```python
d4.plot.line(row='z',col='y', x='x')
#or alternatively
d4.plot.line(row='z',col='y', hue='w')
```
should create a 2d matrix of panels, each having a series of lines, with `hue` corresponding to `w`.
This seems to me like a natural generalization of the behaviour of `plot()`, and I found myself coding manually loops to do that a few times.
","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/2084/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue