-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facetgrid: colors beyond range (extend) not saturated #2932
Comments
For completeness I add the minimal example %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 |
The easiest way to fix this is probably to reset the cmap in facetgrid.py Lines 224-227 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 |
Thanks, I've implemented your suggestion as a workaround, but it fails with the following error:
|
See #3038 |
Seems to work now? probably fixed by #3601 |
Code Sample, a copy-pastable example if possible
Minimal example here:
https://github.com/lvankampenhout/bug-reports/blob/master/Facetgrid_cmap_extend.ipynb
Problem description
The extreme colors of neither the pcolormesh or colorbar (using extend='both') are not saturated as they should when faceting.
Output of
xr.show_versions()
xarray: 0.12.1
pandas: 0.23.4
numpy: 1.14.2
scipy: 0.18.1
netCDF4: 1.3.1
pydap: None
h5netcdf: None
h5py: 2.7.1
Nio: None
zarr: None
cftime: 1.0.0b1
nc_time_axis: None
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.0
dask: 0.13.0
distributed: None
matplotlib: 3.0.2
cartopy: 0.16.0
seaborn: 0.7.1
setuptools: 38.5.1
pip: 9.0.1
conda: 4.6.14
pytest: 3.0.5
IPython: 5.1.0
sphinx: 1.5.1
The text was updated successfully, but these errors were encountered: