Mouse-Follow on Contourf Plots

Hello,

is is there a way to get the mouse hover to follow the actual location when doing a contourf plot? At the moment it jumps around if I just do a very basic example. I have been looking at the help for hv.help(hv.Polygons) but did not seem to find anything.

Here is a minimal example:

import holoviews as hv
import numpy as np
import xarray as xr 
import hvplot.xarray
hv.extension('bokeh')
test_array = xr.DataArray(np.random.rand(460,500) + np.linspace(0,3,500),
                         coords=[np.arange(460), np.arange(500)],
                         dims=['x','y'], name='z')
test_array.hvplot.contourf()

Can you elaborate what you mean by mouse follow?

Yes, of course: in a contourf plot, the location of the “hover info box” follows the nearest contour line and then “jumps”. Thus, it isn’t directly under your cursor. If you execute my example you might see what I mean.

Since that likely doesn’t clarify, I will make a gif and post it here tomorrow

I think I understand; I don’t think it’s possible with contourf, but you can use pcolormesh instead (and set color_levels in opts)