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/619#issuecomment-753619463,https://api.github.com/repos/pydata/xarray/issues/619,753619463,MDEyOklzc3VlQ29tbWVudDc1MzYxOTQ2Mw==,26384082,2021-01-03T13:46:13Z,2021-01-03T13:46:13Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,110807626 https://github.com/pydata/xarray/issues/619#issuecomment-459888596,https://api.github.com/repos/pydata/xarray/issues/619,459888596,MDEyOklzc3VlQ29tbWVudDQ1OTg4ODU5Ng==,2448579,2019-02-01T22:23:19Z,2019-02-01T22:25:23Z,MEMBER,"Found a solution for 1. This function works really well even when resizing a figure on matplotlib 3.0.2: ``` python def make_colorbar(ax, mappable, **kwargs): from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib as mpl divider = make_axes_locatable(ax) orientation = kwargs.pop('orientation', 'vertical') if orientation == 'vertical': loc = 'right' elif orientation == 'horizontal': loc = 'bottom' cax = divider.append_axes(loc, '5%', pad='3%', axes_class=mpl.pyplot.Axes) ax.get_figure().colorbar(mappable, cax=cax, orientation=orientation) ``` ```python import cartopy.crs as ccrs import xarray as xr ds = xr.tutorial.open_dataset('air_temperature').load() ax = plt.subplot(projection=ccrs.LambertConformal()) mappable = ds.air.isel(time=0).plot(transform=ccrs.PlateCarree(), add_colorbar=False) ax.coastlines() ax.gridlines() make_colorbar(ax, mappable, orientation='vertical') ``` ![image](https://user-images.githubusercontent.com/2448579/52152660-64095980-2634-11e9-9eca-612c899171e5.png) ``` python ds = xr.tutorial.open_dataset('air_temperature').load() ax = plt.subplot(projection=ccrs.LambertConformal()) mappable = ds.air.isel(time=0).plot(transform=ccrs.PlateCarree(), add_colorbar=False) ax.coastlines() ax.gridlines() make_colorbar(ax, mappable, orientation='horizontal') ``` ![image](https://user-images.githubusercontent.com/2448579/52152773-dda14780-2634-11e9-87fd-b7a081c8ae03.png) ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,110807626 https://github.com/pydata/xarray/issues/619#issuecomment-459816688,https://api.github.com/repos/pydata/xarray/issues/619,459816688,MDEyOklzc3VlQ29tbWVudDQ1OTgxNjY4OA==,2448579,2019-02-01T18:16:11Z,2019-02-01T18:24:02Z,MEMBER,"One possible solution: https://joseph-long.com/writing/colorbars/ Another approach: https://stackoverflow.com/questions/30030328/correct-placement-of-colorbar-relative-to-geo-axes-cartopy","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,110807626 https://github.com/pydata/xarray/issues/619#issuecomment-459467927,https://api.github.com/repos/pydata/xarray/issues/619,459467927,MDEyOklzc3VlQ29tbWVudDQ1OTQ2NzkyNw==,2443309,2019-01-31T19:10:37Z,2019-01-31T19:10:37Z,MEMBER,This is still a problem.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,110807626 https://github.com/pydata/xarray/issues/619#issuecomment-459420512,https://api.github.com/repos/pydata/xarray/issues/619,459420512,MDEyOklzc3VlQ29tbWVudDQ1OTQyMDUxMg==,26384082,2019-01-31T16:56:30Z,2019-01-31T16:56:30Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,110807626