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/608#issuecomment-146407349,https://api.github.com/repos/pydata/xarray/issues/608,146407349,MDEyOklzc3VlQ29tbWVudDE0NjQwNzM0OQ==,1217238,2015-10-08T03:23:35Z,2015-11-15T21:50:18Z,MEMBER,"I think pcolormesh is slightly more likely to yield correct and consistent results for plotting different types of data than our current hybrid of imshow/contourf. In my experience, pcolormesh also works better with cartopy. For default behavior, I would lean towards being correct rather than fast. Of course, waiting ~0.5 seconds per plot does start to add up when you're faceting, but it's not much more trouble to type .imshow. On Wed, Oct 7, 2015 at 7:04 PM, Joe Hamman notifications@github.com wrote: > ## This is a good point. For me, its not a deal breaker though and the benefits of using pcolormesh all the time (simpler code, broad applicability) are worth the wait. > > Reply to this email directly or view it on GitHub: > https://github.com/xray/xray/pull/608#issuecomment-146393127 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146892645,https://api.github.com/repos/pydata/xarray/issues/608,146892645,MDEyOklzc3VlQ29tbWVudDE0Njg5MjY0NQ==,5356122,2015-10-09T14:46:14Z,2015-10-09T14:46:14Z,MEMBER,"thanks @jhamman for making it work! ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146885534,https://api.github.com/repos/pydata/xarray/issues/608,146885534,MDEyOklzc3VlQ29tbWVudDE0Njg4NTUzNA==,2443309,2015-10-09T14:22:31Z,2015-10-09T14:22:31Z,MEMBER,"Thanks @shoyer and @clarkfitzg for the input on this. Funny how a small change can sometime unravel into a much larger issue. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146761411,https://api.github.com/repos/pydata/xarray/issues/608,146761411,MDEyOklzc3VlQ29tbWVudDE0Njc2MTQxMQ==,1217238,2015-10-09T05:57:22Z,2015-10-09T05:57:22Z,MEMBER,"LGTM ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146758071,https://api.github.com/repos/pydata/xarray/issues/608,146758071,MDEyOklzc3VlQ29tbWVudDE0Njc1ODA3MQ==,2443309,2015-10-09T05:26:46Z,2015-10-09T05:26:46Z,MEMBER,"I'm fine with adding a global option, but yes, we should wait until someone asks for that feature. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146730555,https://api.github.com/repos/pydata/xarray/issues/608,146730555,MDEyOklzc3VlQ29tbWVudDE0NjczMDU1NQ==,1217238,2015-10-09T01:19:05Z,2015-10-09T01:19:05Z,MEMBER,"I'm OK with changing the default to `yincrease=True`. We might consider making this a globally settable option, if, for example, we start to get lots of people familiar with the other convention (popular for images) using xray. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146666438,https://api.github.com/repos/pydata/xarray/issues/608,146666438,MDEyOklzc3VlQ29tbWVudDE0NjY2NjQzOA==,5356122,2015-10-08T19:43:37Z,2015-10-08T19:43:37Z,MEMBER,"I think it's fine to have `yincrease=True` and `xincrease=True` everywhere as the defaults. This is how most people expect graphs to look. This is a place where internal consistency within xray probably beats conforming to the matplotlib defaults. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146656714,https://api.github.com/repos/pydata/xarray/issues/608,146656714,MDEyOklzc3VlQ29tbWVudDE0NjY1NjcxNA==,2443309,2015-10-08T19:06:36Z,2015-10-08T19:06:36Z,MEMBER,"Yes, that was my motivation. Basically, switching to pcolormesh requires us to do this - the alternative is to add `yincrease=True` to all the 2d invocations of `plot` and `pcolormesh` in the docs. I wouldn't say I have a comprehensive sense of how everyone orders their tick labels. In the earth sciences, which is my area of study, I'd say 95% of plots use the standard increasing y notation. The most common use cases for a decreasing y coordinate would probably be depth below the surface (where depth is increasingly positive). One nice thing about setting `yincrease=True` by default, is that all our 2d plots come out with the same orientation. This is different than what you would get with matplotlib so I understand the hesitation. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146636071,https://api.github.com/repos/pydata/xarray/issues/608,146636071,MDEyOklzc3VlQ29tbWVudDE0NjYzNjA3MQ==,1217238,2015-10-08T17:48:10Z,2015-10-08T17:48:10Z,MEMBER,"I'm conflicted about what the default `xincrease`/`yincrease` keyword values should be. In practice, it seems like some datasets need them, and some don't. But it also depends on the specific application. @jhamman could you please explain your reasoning a little more for why we need this switch? Do you have a comprehensive sense of the ways that people organize their data cubes? With climate data, it does seem pretty common that datasets have decreasing latitude values (e.g., 90, 80, 70, ...). This works well with the default behavior of `imshow`, but not `pcolormesh` (unless `yincrease=True`). I suppose this is your motivation? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146625084,https://api.github.com/repos/pydata/xarray/issues/608,146625084,MDEyOklzc3VlQ29tbWVudDE0NjYyNTA4NA==,2443309,2015-10-08T17:04:06Z,2015-10-08T17:04:06Z,MEMBER,"I have updated the docs with a note about speed. I also updated the default behavior of `xincrease` and `yincrease` from `None` to `True`. By going the `pcolormesh` route, it basically forces us to do that (which isn't a bad thing). ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146582311,https://api.github.com/repos/pydata/xarray/issues/608,146582311,MDEyOklzc3VlQ29tbWVudDE0NjU4MjMxMQ==,2443309,2015-10-08T15:39:28Z,2015-10-08T15:39:28Z,MEMBER,"I will add a bit to the docs. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146554007,https://api.github.com/repos/pydata/xarray/issues/608,146554007,MDEyOklzc3VlQ29tbWVudDE0NjU1NDAwNw==,5356122,2015-10-08T13:59:07Z,2015-10-08T13:59:07Z,MEMBER,"Simplification of the logic is a good thing, so I'm fine with this. We should call out the performance difference in the docs, maybe both in the main 2d plot section and the faceting section. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146393127,https://api.github.com/repos/pydata/xarray/issues/608,146393127,MDEyOklzc3VlQ29tbWVudDE0NjM5MzEyNw==,2443309,2015-10-08T02:04:09Z,2015-10-08T02:04:09Z,MEMBER,"This is a good point. For me, its not a deal breaker though and the benefits of using pcolormesh all the time (simpler code, broad applicability) are worth the wait. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146392455,https://api.github.com/repos/pydata/xarray/issues/608,146392455,MDEyOklzc3VlQ29tbWVudDE0NjM5MjQ1NQ==,5356122,2015-10-08T01:58:13Z,2015-10-08T01:58:13Z,MEMBER,"With a 1000 x 1000 grid I'm seeing 10 ms for `imshow` compared to 200 ms for `pcolormesh`. And much longer to render. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146392233,https://api.github.com/repos/pydata/xarray/issues/608,146392233,MDEyOklzc3VlQ29tbWVudDE0NjM5MjIzMw==,5356122,2015-10-08T01:56:35Z,2015-10-08T01:56:35Z,MEMBER,"`pcolormesh` is more general, and works fine. The problem, however, is time! How long does it take to plot and render with the two? `imshow` can be orders of magnitude faster to plot and render. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146369228,https://api.github.com/repos/pydata/xarray/issues/608,146369228,MDEyOklzc3VlQ29tbWVudDE0NjM2OTIyOA==,1217238,2015-10-07T23:49:42Z,2015-10-07T23:49:42Z,MEMBER,"Originally, we only had imshow and contourf. We picked imshow as the default because it shows individual pixels. But pcolormesh also meets that criteria, and has the convenience of also working on non-evenly spaced grid. The only reason to possibly _not_ pick pcolormesh is that it has a different convention from imshow in terms of the image orientation (top-left vs bottom-left origin). Given that xray is largely used for data with meaningful coordinate labels (rather than images), I think it's probably a better choice to use the bottom-left origin as a default. It composing better, for example, with 1D plots. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146341795,https://api.github.com/repos/pydata/xarray/issues/608,146341795,MDEyOklzc3VlQ29tbWVudDE0NjM0MTc5NQ==,2443309,2015-10-07T21:43:58Z,2015-10-07T21:43:58Z,MEMBER,"So, are we okay with the default 2D plot being `pcolormesh`? It certainly simplifies things since we don't have to determine if the coords are uniform and it works for 1D and 2D coords. I think @clarkfitzg may have an objection. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146341309,https://api.github.com/repos/pydata/xarray/issues/608,146341309,MDEyOklzc3VlQ29tbWVudDE0NjM0MTMwOQ==,1217238,2015-10-07T21:41:29Z,2015-10-07T21:41:29Z,MEMBER,"OK, works for me :) On Wed, Oct 7, 2015 at 2:40 PM, Joe Hamman notifications@github.com wrote: > I started to go down the road of removing the squeeze you were talking > about but _infer_interval_breaks got in my way (when len(coord) == 1). I > think this is an important corner case but this PR is getting pretty > cluttered so maybe it is best to save that for another. > > — > Reply to this email directly or view it on GitHub > https://github.com/xray/xray/pull/608#issuecomment-146341080. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146341080,https://api.github.com/repos/pydata/xarray/issues/608,146341080,MDEyOklzc3VlQ29tbWVudDE0NjM0MTA4MA==,2443309,2015-10-07T21:40:14Z,2015-10-07T21:40:14Z,MEMBER,"I started to go down the road of removing the squeeze you were talking about but `_infer_interval_breaks` got in my way (when `len(coord) == 1`). I think this is an important corner case but this PR is getting pretty cluttered so maybe it is best to save that for another. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146316910,https://api.github.com/repos/pydata/xarray/issues/608,146316910,MDEyOklzc3VlQ29tbWVudDE0NjMxNjkxMA==,1217238,2015-10-07T20:21:48Z,2015-10-07T20:21:48Z,MEMBER,"> so you would have a DataArray of shape (1, 5) be plotted via pcolormesh (by default)? Either that, or we should extract the `row` and `col` arguments first, to ensure they aren't squeezed out. On the other hand, it's not so terrible to encourage people use to explicit plot method in applications instead of the generic `.plot`, so maybe this isn't entirely necessary. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146316096,https://api.github.com/repos/pydata/xarray/issues/608,146316096,MDEyOklzc3VlQ29tbWVudDE0NjMxNjA5Ng==,2443309,2015-10-07T20:18:15Z,2015-10-07T20:18:15Z,MEMBER,"so you would have a DataArray of shape (1, 5) be plotted via pcolormesh (by default)? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146313271,https://api.github.com/repos/pydata/xarray/issues/608,146313271,MDEyOklzc3VlQ29tbWVudDE0NjMxMzI3MQ==,1217238,2015-10-07T20:06:05Z,2015-10-07T20:06:05Z,MEMBER,"While you're at it -- maybe the default `.plot` method shouldn't start with `darray.squeeze()`? That sort of behavior starts to make things behavior to predict. In particular, faceting should still work consistently even if one of the dimensions only has length 1. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146312066,https://api.github.com/repos/pydata/xarray/issues/608,146312066,MDEyOklzc3VlQ29tbWVudDE0NjMxMjA2Ng==,1217238,2015-10-07T20:02:01Z,2015-10-07T20:02:01Z,MEMBER,"> How about making the default pcolormesh since that works in all cases? :+1: ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146310923,https://api.github.com/repos/pydata/xarray/issues/608,146310923,MDEyOklzc3VlQ29tbWVudDE0NjMxMDkyMw==,2443309,2015-10-07T19:58:10Z,2015-10-07T19:58:10Z,MEMBER,"> Can we make it so the generic .plot(x='x2d', y='x2d') works? How about making the default `pcolormesh` since that works in all cases? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146310353,https://api.github.com/repos/pydata/xarray/issues/608,146310353,MDEyOklzc3VlQ29tbWVudDE0NjMxMDM1Mw==,1217238,2015-10-07T19:55:41Z,2015-10-07T19:56:30Z,MEMBER,"Can we make it so the generic `.plot(x='lon', y='lat')` works? Right now it defaults to imshow is the dimensions are equally spaced but that logic isn't probably right anymore if we allow different x/y labels: https://github.com/xray/xray/blob/cb4e4138fdb52078d27341dadf0feedb15e1de80/xray/plot/plot.py#L161 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146296448,https://api.github.com/repos/pydata/xarray/issues/608,146296448,MDEyOklzc3VlQ29tbWVudDE0NjI5NjQ0OA==,2443309,2015-10-07T19:05:19Z,2015-10-07T19:05:19Z,MEMBER,"I think this is ready for a review. This fixes #611 and allows us to pass 2d coordinate names into plotting methods. ``` Python # Fixed FacetGrid labels fg = da.plot.pcolormesh(col='time', col_wrap=4) ``` ![fixed_labels](https://cloud.githubusercontent.com/assets/2443309/10347802/81125b82-6cea-11e5-826e-59667b135901.png) ``` Python # 2d coord names ax = plt.axes(projection=Rasm()) ds.frac.plot.pcolormesh(x='xc', y='yc', transform=cartopy.crs.PlateCarree()) ``` ![fixed2d](https://cloud.githubusercontent.com/assets/2443309/10347983/666bd226-6ceb-11e5-98e9-30f3af895b8b.png) ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146082365,https://api.github.com/repos/pydata/xarray/issues/608,146082365,MDEyOklzc3VlQ29tbWVudDE0NjA4MjM2NQ==,2443309,2015-10-07T05:44:32Z,2015-10-07T05:44:32Z,MEMBER,"> ...only handle two cases This is exactly where I was headed. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577 https://github.com/pydata/xarray/pull/608#issuecomment-146082141,https://api.github.com/repos/pydata/xarray/issues/608,146082141,MDEyOklzc3VlQ29tbWVudDE0NjA4MjE0MQ==,1217238,2015-10-07T05:42:07Z,2015-10-07T05:42:07Z,MEMBER,"Maybe instead of the complex fallback logic to handle specifying x and/or y, we should rewrite this to only handle two cases: 1. Both x and y are provided explicitly. They can be any coordinate variables. 2. Neither x nor y is provided, so use dims to provide default values. Something like this... ``` python def _infer_xy_labels(plotfunc, darray, x, y): if x is None and y is None: if darray.ndim != 2: raise ValueError('must be 2d') x, y = darray.dims elif x is None or y is None: raise ValueError('cannot supply only one of x and y') elif any(k not in darray.coords for k in (x, y)): raise ValueError('x and y must be coordinate variables') return x, y ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,109665577