Cannot use apply.opts on 'logz', and any change resets axes (panning)

Hello, first message here, thank you for keeping this community alive, it’s an amazing source of information :slight_smile:

I am trying to update the color scale of a heatmap using panel widgets, linking them to plot option with ‘apply.opts’.

A range slider is supposed to control the colormap limits clim and I would like to control whether the color scale is logarithmic with a checkbox.

import numpy as np
import pandas as pd
import holoviews as hv

# Create values
val_min=2
val_max=5
sweep_values = np.linspace(start=val_min, 
                           stop=val_max, 
                           num=100)

# Single column heatmap
hm=hv.HeatMap({'x':'test', 
               'y':sweep_values, 
               'z':sweep_values})

# Create a range slider to define colors boundaries
range_slider = pn.widgets.RangeSlider(name='Scale boundaries', 
                                      start=val_min, 
                                      end=val_max, 
                                      value=(val_min, val_max), 
                                      step=0.01)

# And a checkbox to control whether colorscale is logarithmic
logscale_checkbox = pn.widgets.Checkbox(name="Logarithmic scale", value=False)

# Link widgets params to corresponding options in plot
hm=hm.apply.opts(clim=range_slider, logz=logscale_checkbox)

# Show off
pn.Row(hm, range_slider, logscale_checkbox)

The range slider does its job, but as soon as I use it, the position of axes is reset (after modifying them manually with the panning tool).
Is this the expected behavior ? I would like the panning position to be kept unchanged when updating the colorscale.

The checkbox triggers a plot update (I notice because axes are reset), but the logz option is not applied dynamically (works if applied statically before plotting).

Maybe ‘apply.opts’ it is not the best option, please let me know if there is a better way…
To be honest I am confused about the best options to use for linking objects: pn.bind, apply.opts, streams, datalink, subscribe, watch, js_on_events… (I listed 13 of them).

Thank you for your help !

Session info:

holoviews           1.15.4
numpy               1.23.5
pandas              1.5.3
panel               0.14.3

Quick update, it seems that the ‘reset axes on slider change’ behavior is not seen when I change Y axis from categorical to numeric:

# Single column heatmap
hm=hv.HeatMap({'x':0, 
               'y':sweep_values, 
               'z':sweep_values})