I am creating a hvplot of a multivariate netcdf / xarray datasets and am trying to override the default hover tool such that only variable value is displayed in the hover tool (i.e. no x/y coords).
I have successfully used tooltips=[(“value”,"@image")] when creating a hvplot.image() …(See hypothetical example below) but cannot reproduce the same result using hvplot.quadmesh(). I have attempted using “@z” in the tooltips but always end up with ??? in the hover
import xarray as xr
import hvplot.pandas # noqa
import hvplot.xarray # noqa
import cartopy.crs as ccrs
from bokeh import models
import numpy as np
air_ds = xr.tutorial.open_dataset('air_temperature').load()
air_ds['air2'] = air_ds['air'] * 2
# Using hvplot.image() works
# @image for multivariate hvplot.image()
hover = models.HoverTool(tooltips=[("value", "@image"),
])
air_ds.hvplot.image(
x='lon', y='lat', z= list(air_ds.data_vars), projection=ccrs.Orthographic(-90, 30),
global_extent=True, frame_height=540, cmap='viridis', tools=[hover],
coastline=True
)
# Quadmesh hover not working
# '@z' not ok ... gives ???
hover = models.HoverTool(tooltips=[("value", "@z"),
])
air_ds.hvplot.quadmesh(
x='lon', y='lat', z= list(air_ds.data_vars), projection=ccrs.Orthographic(-90, 30),
global_extent=True, frame_height=540, cmap='viridis', tools=[hover],
coastline=True
)
Any guidance would be great
Cheers