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/1885#issuecomment-366540505,https://api.github.com/repos/pydata/xarray/issues/1885,366540505,MDEyOklzc3VlQ29tbWVudDM2NjU0MDUwNQ==,1386642,2018-02-18T19:26:31Z,2018-02-18T19:26:31Z,CONTRIBUTOR,cool! Thanks,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-366538974,https://api.github.com/repos/pydata/xarray/issues/1885,366538974,MDEyOklzc3VlQ29tbWVudDM2NjUzODk3NA==,1217238,2018-02-18T19:06:36Z,2018-02-18T19:06:36Z,MEMBER,Thanks @nbren12 !,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-366468848,https://api.github.com/repos/pydata/xarray/issues/1885,366468848,MDEyOklzc3VlQ29tbWVudDM2NjQ2ODg0OA==,1386642,2018-02-17T20:24:36Z,2018-02-17T20:24:36Z,CONTRIBUTOR,I just rebased onto master.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-366468662,https://api.github.com/repos/pydata/xarray/issues/1885,366468662,MDEyOklzc3VlQ29tbWVudDM2NjQ2ODY2Mg==,16011037,2018-02-17T20:21:12Z,2018-02-17T20:21:12Z,CONTRIBUTOR,"I couldn't find a `.stickler.yml` file in this repository. I can make [one for you](https://stickler-ci.com/repositories?name=pydata/xarray&dialog=createconfig), or you can create one by following the [documentation](https://stickler-ci.com/docs).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-365372937,https://api.github.com/repos/pydata/xarray/issues/1885,365372937,MDEyOklzc3VlQ29tbWVudDM2NTM3MjkzNw==,1386642,2018-02-13T19:15:30Z,2018-02-13T19:15:47Z,CONTRIBUTOR,no problem. I have always preferred putting operators on new lines though. Didn't realize that was against pep8. oh well 🤷♂️ . ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-365359131,https://api.github.com/repos/pydata/xarray/issues/1885,365359131,MDEyOklzc3VlQ29tbWVudDM2NTM1OTEzMQ==,10050469,2018-02-13T18:28:25Z,2018-02-13T18:28:25Z,MEMBER,"Sorry, our new flake8 tool can be quite strict ;)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-365332360,https://api.github.com/repos/pydata/xarray/issues/1885,365332360,MDEyOklzc3VlQ29tbWVudDM2NTMzMjM2MA==,1386642,2018-02-13T17:01:26Z,2018-02-13T17:01:26Z,CONTRIBUTOR,"> Sorry @nbren12 there is still a pep8 error somewhere, and you can freely make it an error as @shoyer suggests.
Hopefully, the commit I just pushed fixes this. I had some global flake8 settings that were messing with my local linting.
> Note that currently the test for monotonic coords is for `pcolormesh` only, while it could be for all 2d plots as well.
I don't think I was having any issues with `contour` or `contourf` when I first opened the issue, but it probably does break `imshow`.
> If we start to check input for sanity we might as well raise an error when coordinates are not regularly spaced in the imshow case.
Maybe we could leave this to a later PR.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-365064764,https://api.github.com/repos/pydata/xarray/issues/1885,365064764,MDEyOklzc3VlQ29tbWVudDM2NTA2NDc2NA==,10050469,2018-02-12T21:16:55Z,2018-02-12T21:16:55Z,MEMBER,"Sorry @nbren12 there is still a pep8 error somewhere, and you can freely make it an error as @shoyer suggests.
Note that currently the test for monotonic coords is for pcolormesh only, while it could be for all 2d plots as well. What I like with the current implementation is that the check happens in `_infer_interval_breaks`, which is only called when certain conditions are met (1D coords, or 2D coords without transform kwarg). If this check lives in the common 2d function the same conditions should be applied.
If we start to check input for sanity we might as well raise an error when coordinates are not regularly spaced in the imshow case, although I can imagine this might be more difficult to check.
Thoughts?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-363533796,https://api.github.com/repos/pydata/xarray/issues/1885,363533796,MDEyOklzc3VlQ29tbWVudDM2MzUzMzc5Ng==,1386642,2018-02-06T19:17:40Z,2018-02-06T19:17:40Z,CONTRIBUTOR,"Yah. I knew my solution before was probably too cute.
On Tue, Feb 6, 2018 at 11:14 AM, Fabien Maussion
wrote:
> Thanks! This looks good.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> , or mute
> the thread
>
> .
>
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-363532796,https://api.github.com/repos/pydata/xarray/issues/1885,363532796,MDEyOklzc3VlQ29tbWVudDM2MzUzMjc5Ng==,10050469,2018-02-06T19:14:31Z,2018-02-06T19:14:31Z,MEMBER,Thanks! This looks good.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-363531759,https://api.github.com/repos/pydata/xarray/issues/1885,363531759,MDEyOklzc3VlQ29tbWVudDM2MzUzMTc1OQ==,1386642,2018-02-06T19:11:04Z,2018-02-06T19:11:04Z,CONTRIBUTOR,There. I think this code should work for all dtypes and 2D coords. ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-363528599,https://api.github.com/repos/pydata/xarray/issues/1885,363528599,MDEyOklzc3VlQ29tbWVudDM2MzUyODU5OQ==,10050469,2018-02-06T19:00:45Z,2018-02-06T19:01:21Z,MEMBER,"Which, I guess, illustrates our point quite well: while it's easy for users to find out when their data is messy, it's much harder to find a robust and logical way to handle all cases for a general library like xarray. I guess it's the reason why matplotlib also doesn't warn or error when unordered data is given to pcolormesh.
Don't get me wrong: I think it would be valuable to be able to provide a better ""service"" than matplotlib. Probably we should even error earlier, at the 2d plot level (and not only at the pcolormesh level like it is now). It's just going to be a bit hard because of all the special cases (dtypes, 2d coords, and map projections moslty).
Ordering ""per default"" might be the most straightforward way, but:
- what about performance issues?
- I don't like the idea of silently doing things with user data
I'll let @shoyer decide on what's best here. I am slightly in favor of doing nothing and giving the responsibility to the user.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362992657,https://api.github.com/repos/pydata/xarray/issues/1885,362992657,MDEyOklzc3VlQ29tbWVudDM2Mjk5MjY1Nw==,1386642,2018-02-05T06:24:40Z,2018-02-05T06:24:40Z,CONTRIBUTOR,"> One reason is that it's not obvious if they would like increasing or decreasing coordinates.
For me at least, `plt.pcolormesh` automatically displays in increasing order even if one of the input arrays is sorted in descending order. This happens all the time with meteorological data available in pressure coordinates (pressure goes down with height). I usually have to manually call plt.gca().invert_yaxis() to flip the y axis. Does `xarray.plot`'s behave differently?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362991345,https://api.github.com/repos/pydata/xarray/issues/1885,362991345,MDEyOklzc3VlQ29tbWVudDM2Mjk5MTM0NQ==,1217238,2018-02-05T06:15:12Z,2018-02-05T06:15:12Z,MEMBER,"> Is there any chance people would want to make heatmaps involving categorical variables though?
Certainly, but the currently version of 2D plots in xarray doesn't work for these!
If they want to make plots involving categorical variables, I would currently recommend using `seaborn.heatmap` (we can mention it in the error message, too).
> If we do decide to raise an error, why not go one step further and just
sort the coordinates automatically?
One reason is that it's not obvious if they would like increasing or decreasing coordinates.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362990917,https://api.github.com/repos/pydata/xarray/issues/1885,362990917,MDEyOklzc3VlQ29tbWVudDM2Mjk5MDkxNw==,1386642,2018-02-05T06:12:08Z,2018-02-05T06:12:08Z,CONTRIBUTOR,"@shoyer That would work with me. Is there any chance people would want to
make heatmaps involving categorical variables though?
If we do decide to raise an error, why not go one step further and just
sort the coordinates automatically?
On Sun, Feb 4, 2018 at 4:00 PM, Stephan Hoyer
wrote:
> *@shoyer* commented on this pull request.
> ------------------------------
>
> In xarray/plot/plot.py
> :
>
> > @@ -750,6 +767,13 @@ def _infer_interval_breaks(coord, axis=0):
> [ 2.5, 3.5, 4.5]])
> """"""
> coord = np.asarray(coord)
> +
> + if not _is_monotonic(coord, axis=axis):
> + warnings.warn(""The input coordinate is not sorted in increasing order ""
>
> Rather an a warning, why not make this an error? I don't see any use-cases
> for 2d plots with non-monotonic coordinates. With the current version of
> xarray, these plots always end up wrong in some way, either by not plotting
> everything or with bad axis labels.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> ,
> or mute the thread
>
> .
>
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362853059,https://api.github.com/repos/pydata/xarray/issues/1885,362853059,MDEyOklzc3VlQ29tbWVudDM2Mjg1MzA1OQ==,1386642,2018-02-03T20:47:30Z,2018-02-03T20:47:30Z,CONTRIBUTOR,Ok. I think everything is ready now.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362836782,https://api.github.com/repos/pydata/xarray/issues/1885,362836782,MDEyOklzc3VlQ29tbWVudDM2MjgzNjc4Mg==,1386642,2018-02-03T17:21:16Z,2018-02-03T17:21:16Z,CONTRIBUTOR,Thanks for your help @fmaussion. Hopefully the commit I just pushed fixes the failing tests. I will work on adding a test and fixing the formatting.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233
https://github.com/pydata/xarray/pull/1885#issuecomment-362796338,https://api.github.com/repos/pydata/xarray/issues/1885,362796338,MDEyOklzc3VlQ29tbWVudDM2Mjc5NjMzOA==,10050469,2018-02-03T10:28:27Z,2018-02-03T10:28:27Z,MEMBER,"Thanks a lot @nbren12 ! Indeed `_infer_interval_breaks` is probably the right place to add this warning.
A few comments:
- the tests are now failing, likely because of a type issue with time coordinates
- coordinates don't have to be ascending for pcolormesh to work (see example below). Monotonically ascending and descending coordinates should work.
- we need a test for this new behavior ([asserting warnings](https://docs.pytest.org/en/3.0.2/recwarn.html))
- we follow the pep8 conventions, and I think your lines are longer than the 79 character rule
```python
import numpy as np
import xarray as xr
x = np.arange(5)[::-1]
y = np.arange(6)[::-1]
x = xr.DataArray(x, dims=['x'], coords={'x': x})
y = xr.DataArray(y, dims=['y'], coords={'y': y})
z = x + y
z.plot();
```

","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,294089233