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/1397#issuecomment-299202380,https://api.github.com/repos/pydata/xarray/issues/1397,299202380,MDEyOklzc3VlQ29tbWVudDI5OTIwMjM4MA==,10050469,2017-05-04T14:30:46Z,2017-05-04T14:30:46Z,MEMBER,"OK, I've had success with ``ax.set_aspect('equal', 'box-forced')``: ```python p = ano.T2M.plot(col='month', col_wrap=4, transform=ccrs.PlateCarree(), subplot_kws={'projection': ccrs.PlateCarree()}); for ax in p.axes.flat: ax.add_feature(cartopy.feature.BORDERS) ax.add_feature(cartopy.feature.COASTLINE) ax.set_extent([70, 100, 25, 40]) ax.set_aspect('equal', 'box-forced') ```  Note that the result will look better if you set ``aspect`` in xarray's facetgrid first, since it will decide on a cleverer figsize based on this information: ```python p = ano.T2M.plot(col='month', col_wrap=4, transform=ccrs.PlateCarree(), aspect=ds.dims['lon']/ds.dims['lat'], subplot_kws={'projection': ccrs.PlateCarree()}); for ax in p.axes.flat: ax.add_feature(cartopy.feature.BORDERS) ax.add_feature(cartopy.feature.COASTLINE) ax.set_extent([70, 100, 25, 40]) ax.set_aspect('equal', 'box-forced') ```  ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299194997,https://api.github.com/repos/pydata/xarray/issues/1397,299194997,MDEyOklzc3VlQ29tbWVudDI5OTE5NDk5Nw==,4992424,2017-05-04T14:05:48Z,2017-05-04T14:05:48Z,NONE,"Cool; please keep me in the loop if you don't mind, because I also have an application which I'd really like to just be able use the built-in faceting for rather than building my plot grids manually. A good comparison case is to perform the same plots (with the same set aspect/size/ratio at both the figure and subplot level) but just don't use the Cartopy transformations. In these cases, I have all the control that I would expect. There are also important differences between `pcolor`ing and `imshow`ing which would be useful to understand. At a minimum, we should deliver back to **xarray** some improved documentation discussing handling subplot geometry during faceting.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299193840,https://api.github.com/repos/pydata/xarray/issues/1397,299193840,MDEyOklzc3VlQ29tbWVudDI5OTE5Mzg0MA==,10050469,2017-05-04T14:01:37Z,2017-05-04T14:01:37Z,MEMBER,"``aspect='auto'`` does ""work"", but it looks ugly because it doesn't preserve aspect ratio:  The default is ``aspect='equal'``, which is good for the maps geometry but it shouldn't be ignored by the axes of the facetgrid, I think we have to do something on the xarray side here, unless there is a way to preserve the aspect ratio already. I'll dig into this. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299191499,https://api.github.com/repos/pydata/xarray/issues/1397,299191499,MDEyOklzc3VlQ29tbWVudDI5OTE5MTQ5OQ==,4992424,2017-05-04T13:53:09Z,2017-05-04T13:53:09Z,NONE,"@fmaussion What happens if you add `aspect=""auto""` to **subplot_kws**? I'm tempted to have us move this discussion to StackOverflow (for heightened visibility), but I suspect there might actually be a bug somewhere in the finalization of the faceting that undoes the specifications you pass to the initial subplot constructor.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299190567,https://api.github.com/repos/pydata/xarray/issues/1397,299190567,MDEyOklzc3VlQ29tbWVudDI5OTE5MDU2Nw==,10050469,2017-05-04T13:49:40Z,2017-05-04T13:49:40Z,MEMBER,"@darothen did you find out how to control the map extent in facetgrids? See this example: ```python p = ano.T2M.plot(col='month', col_wrap=4, transform=ccrs.PlateCarree(), subplot_kws={'projection': ccrs.PlateCarree()}); for ax in p.axes.flat: ax.add_feature(cartopy.feature.BORDERS) ax.add_feature(cartopy.feature.COASTLINE) ax.set_extent([70, 100, 25, 40]) ``` Cartopy basically ignores my ``extent'' since it wants to make the plots more quadratic than they should:  ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299056235,https://api.github.com/repos/pydata/xarray/issues/1397,299056235,MDEyOklzc3VlQ29tbWVudDI5OTA1NjIzNQ==,4992424,2017-05-03T22:43:55Z,2017-05-03T22:43:55Z,NONE,"> The biggest trouble I have is with tightening the space between the map and the colorbar at the bottom, but this looks like a cartopy/mpl question, not an xarray question, so I should quit pestering you guys. You just need to pass the ""pad"" argument to `cbar_kwargs`. The trickier problem is that sometimes cartopy can be a bit unpredictable in controlling the size and aspect ratio of axes after you've plotted maps on them. You can force a plot to respect the aspect ratio you use when you construct an axis by using the keyword `aspect=""auto""`, but it can be a bit difficult to get this to work in xarray sometimes. But at the end of the day, it's not a big deal to hand-craft a publication-quality figure once you know the rough gist of what you want to go on it - and xarray's tools are already great for that.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299053751,https://api.github.com/repos/pydata/xarray/issues/1397,299053751,MDEyOklzc3VlQ29tbWVudDI5OTA1Mzc1MQ==,13760223,2017-05-03T22:30:01Z,2017-05-03T22:30:01Z,NONE,"Customizing legend, fonts, title, things like that. I'm slowly getting through it - mostly because I am new to cartopy and not that experienced with matplotlib overall. The biggest trouble I have is with tightening the space between the map and the colorbar at the bottom, but this looks like a cartopy/mpl question, not an xarray question, so I should quit pestering you guys.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299049285,https://api.github.com/repos/pydata/xarray/issues/1397,299049285,MDEyOklzc3VlQ29tbWVudDI5OTA0OTI4NQ==,10050469,2017-05-03T22:06:16Z,2017-05-03T22:06:16Z,MEMBER,What is it exactly what you are trying to do?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299040588,https://api.github.com/repos/pydata/xarray/issues/1397,299040588,MDEyOklzc3VlQ29tbWVudDI5OTA0MDU4OA==,13760223,2017-05-03T21:26:49Z,2017-05-03T21:26:49Z,NONE,Without a doubt - once I figure out how to do it!,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299027358,https://api.github.com/repos/pydata/xarray/issues/1397,299027358,MDEyOklzc3VlQ29tbWVudDI5OTAyNzM1OA==,1197350,2017-05-03T20:35:11Z,2017-05-03T20:35:11Z,MEMBER,"> A simple example would go a long way @CommonClimate, you are now the ideal contributor to create such an example for the docs. 😉 ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299021450,https://api.github.com/repos/pydata/xarray/issues/1397,299021450,MDEyOklzc3VlQ29tbWVudDI5OTAyMTQ1MA==,13760223,2017-05-03T20:11:27Z,2017-05-03T20:11:27Z,NONE,"Thanks Fabien, this is helpful. It would be great to see how the output of the `plot()` function can be broadcast to axes or handles, so that they can be manipulated at will. Right now, typing `a = s.Tair[0].plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), x='xc', y='yc', cbar_kwargs={'orientation':'horizontal'});` returns a complex object that is a bit forbidding for a first-time user without any example in the doc. A simple example would go a long way, but I understand that everything takes time and no-one is getting paid for this! cheers Julien","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299009125,https://api.github.com/repos/pydata/xarray/issues/1397,299009125,MDEyOklzc3VlQ29tbWVudDI5OTAwOTEyNQ==,10050469,2017-05-03T19:19:59Z,2017-05-03T19:19:59Z,MEMBER,"> it's simple to add the colorbar, but not easy to make it horizontal You can try: ``` ds.Tair[0].plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), x='xc', y='yc', cbar_kwargs={'orientation':'horizontal'}); ``` > xarray plotting tools, which are useful for quick checks, but not publication-quality figures? Yes, as a general purpose tool xarray will try to avoid the proliferation of keyword arguments. If you have very specific needs you might need to tweak the plots yourself. Fortunately, this is easy to do on top of xarray since you can control the axes, plots, and so on. We could add more advanced examples to the docs though (for example in the gallery I had no time to add yet :( ) ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-299001180,https://api.github.com/repos/pydata/xarray/issues/1397,299001180,MDEyOklzc3VlQ29tbWVudDI5OTAwMTE4MA==,13760223,2017-05-03T18:48:06Z,2017-05-03T18:48:06Z,NONE,"@fmaussion thanks, I think I know what the problem is: the last command I was using was `ax.set_ylim([0,90])`, not `plt.tight_layout()`. With the latter, everything shows up properly with the correct projection. I guess I was working with an older version of the notebook, which had the former command, not the latter. Bonus question for @shoyer : it's simple to add the colorbar, but not easy to make it horizontal, for instance. Is the idea is that if a lot of customization is desired, users should go with more direct cartopy commands, rather than xarray plotting tools, which are useful for quick checks, but not publication-quality figures? thanks","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-298914845,https://api.github.com/repos/pydata/xarray/issues/1397,298914845,MDEyOklzc3VlQ29tbWVudDI5ODkxNDg0NQ==,1197350,2017-05-03T13:44:42Z,2017-05-03T13:44:42Z,MEMBER,"When I put together the tutorial, I remember that the Robinson projection was the only one that worked reliably. But that was more than a year ago--hopefully updating package versions can fix the issue.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-298855171,https://api.github.com/repos/pydata/xarray/issues/1397,298855171,MDEyOklzc3VlQ29tbWVudDI5ODg1NTE3MQ==,10050469,2017-05-03T08:49:23Z,2017-05-03T08:49:23Z,MEMBER,"This is what I get: ```python import xarray as xr import cartopy import cartopy.crs as ccrs import matplotlib import matplotlib.pyplot as plt %matplotlib inline print(xr.__version__) print(cartopy.__version__) print(matplotlib.__version__) ds = xr.tutorial.load_dataset('rasm') plt.figure(figsize=(14, 4)); ax = plt.axes(projection=ccrs.Robinson()); ds.Tair[0].plot.pcolormesh(ax=ax, transform=ccrs.PlateCarree(), x='xc', y='yc', add_colorbar=False); ax.coastlines(); plt.tight_layout(); ``` ``` 0.9.5-1-gab4ffee 0.14.2 2.0.0 ```  ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-298843881,https://api.github.com/repos/pydata/xarray/issues/1397,298843881,MDEyOklzc3VlQ29tbWVudDI5ODg0Mzg4MQ==,13760223,2017-05-03T07:48:21Z,2017-05-03T07:48:21Z,NONE,"@shoyer thanks for this tip. As you say, having to specify the transform is prodigiously unintuitive for a first-time cartopy user (my case). Unfortunately, I get the problem with or without applying transform=ccrs.PlateCarree(). @fmaussion yes, that is precisely the code I used, switching PlateCarree() for Robinson() in cell 16. The only output I get when I do this is the bottom legend; the rest of the plot vanishes. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-298832853,https://api.github.com/repos/pydata/xarray/issues/1397,298832853,MDEyOklzc3VlQ29tbWVudDI5ODgzMjg1Mw==,10050469,2017-05-03T06:32:56Z,2017-05-03T06:32:56Z,MEMBER,"I don't have this problem. did you use the code from the documentation? http://xarray.pydata.org/en/latest/examples/multidimensional-coords.html","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258 https://github.com/pydata/xarray/issues/1397#issuecomment-298814633,https://api.github.com/repos/pydata/xarray/issues/1397,298814633,MDEyOklzc3VlQ29tbWVudDI5ODgxNDYzMw==,1217238,2017-05-03T03:17:00Z,2017-05-03T03:17:00Z,MEMBER,"What exactly did you type? Note that even if you set `projection=Robinson()` you still need `transform=ccrs.PlateCarree()` (e.g., see https://github.com/SciTools/cartopy/issues/645).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,225846258