holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.69k stars 403 forks source link

Fixing colorlimits for map plots. #3543

Closed jbusecke closed 5 years ago

jbusecke commented 5 years ago

Hi I am quite new to plotting with holoview, geoviews and hvplot. I am trying to explore large gridded datasets of global ocean models. But I am not able to find out how to fix the limits of the colorbar, when grouping over time.

When I move the time slider, the colorlimits jump all over the place and it is very hard to see changes that way.

Is there a convienient way to set the colorlimits, similar to vmin and vmax in matplotlib for both Quadmesh and Contourf plots?

The example from the documentation reproduces the same behaviour:

import xarray as xr, hvplot.xarray, cartopy.crs as crs, geoviews as gv

air_ds = xr.tutorial.open_dataset('air_temperature').load()

air_ds.hvplot.quadmesh(
    'lon', 'lat', 'air', projection=ccrs.Orthographic(-90, 30),
    global_extent=True, width=600, height=540, cmap='viridis'
) * gv.feature.coastline
poplarShift commented 5 years ago

Would e.g. .redim.range(air=(230,300)) help?

philippjfr commented 5 years ago

Recent versions of holoviews and hvplot also have clim option.