Restrict scroll to only resize X-axis

Hi all! I’ve created a holoviews Curve panel with datashade to view a time-series plot containing many values. I want to add an option to zoom only on the x-axis so that a user can zoom in on a waveform without losing the entirety of the y-axis scale. Ideally both this and the default zoom on both x and y axes would exist. Is this possible?

This is currently how I initialize my holoviews curve and data shader plot if it’s any help:

    hv_plot = hv.Curve((downsampled_x.astype('datetime64[ms]'), downsampled_y)).opts(
        responsive=True, 
        min_height=400, 
        axiswise=True,
        line_width=2
    )

    # Apply datashader
    hv_plot = hd.datashade(hv_plot).opts(
        title= sources + " Z-Acceleration vs. Time",
        xlabel="Time (ms)",
        ylabel="Z-Acceleration (g)",
        height=500, 
        responsive=True)

I think you just need to specify the tools:
hv_plot.opts(tools=["xwheel_zoom", "wheel_zoom"])

1 Like

Thank you very much, this is exactly it. I appreciate your time :slightly_smiling_face:

1 Like