Define z axis range for image plot

I’d like to use hvplot to display a sequence of array values accessed from a netCDF file via xarray. Each plot represents water budget components (e.g. rainfall, snowmelt, etc.). Ideally, the scale used to display each days’ worth of data would not change from day to day.

==> Is there any way to define the scale of the colorbar used to represent values in a hvplot image plot so that it remains the same as one loads a sequence of gridded values?

You should be able to set the range with the clim option but I may not be getting the full context so let me know if that doesn’t solve your problem.

Thank you! That works perfectly. I wasn’t able to parse it out of the documentation. For completeness, here is what I ended up doing to create a visualization created with a consistent colormap over time steps:

import xarray as xr
import holoviews as hv
from hvplot import xarray

net_infil_file = ''
net_infil_data = xr.open_dataset(net_infil_file)
net_infil = net_infil_data.net_infiltration

net_infil.hvplot(groupby='time', width=800, height=600, widget_type='scrubber', widget_location='bottom', clim=(0,1), xformatter='%.0f', yformatter='%.0f')

1 Like