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/2932#issuecomment-487947321,https://api.github.com/repos/pydata/xarray/issues/2932,487947321,MDEyOklzc3VlQ29tbWVudDQ4Nzk0NzMyMQ==,10194086,2019-04-30T13:15:05Z,2019-05-02T09:00:07Z,MEMBER,"For completeness I add the minimal example ``` python %matplotlib import numpy as np; import xarray as xr da = xr.tutorial.open_dataset('air_temperature').air cmap = 'RdBu_r' levels = np.arange(240,300+1,10) da.isel(time=slice(4)).plot(cmap=cmap, col='time', levels=levels, extend='both') ``` What I think happens is that the `cmap` is determined twice. First in [facetgrid.py](https://github.com/pydata/xarray/blob/master/xarray/plot/facetgrid.py#L225-L226). This returns a `matplotlib.colors.ListedColormap` with 6 colors. Then this reduced colormap is used in [plot.py](https://github.com/pydata/xarray/blob/master/xarray/plot/plot.py#L630-L631). However, now it only has 6 colors to choose from, so the `_over` and `_under` colors are the same as the first and last color. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,438694589 https://github.com/pydata/xarray/issues/2932#issuecomment-487963898,https://api.github.com/repos/pydata/xarray/issues/2932,487963898,MDEyOklzc3VlQ29tbWVudDQ4Nzk2Mzg5OA==,10194086,2019-04-30T14:01:14Z,2019-04-30T14:01:14Z,MEMBER,"The easiest way to fix this is probably to reset the cmap in [facetgrid.py Lines 224-227](https://github.com/pydata/xarray/blob/master/xarray/plot/facetgrid.py#L224-L227) ``` python cmap = kwargs.get('cmap', None) cmap_params, cbar_kwargs = _process_cmap_cbar_kwargs(func, kwargs, self.data.values) # reset the colormap #GH2932 cmap_params['cmap'] = cmap ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,438694589