0

I 've created 2 heatmaps (one for each year) from the following csv https://drive.google.com/file/d/1JRgKCMZsv_e8UifbAz-OuLteBrdZTulb/view?usp=sharing using this code

import pandas as pd
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')
data = pd.read_csv('book6.csv', delimiter=';')
vdims = ('V132', 'SE132')
heatmaps = []

for etos in [2015, 2016]:
    data1 = data[data['YEAR'] == etos]
    ds = hv.Dataset(data1, ['TF14', 'NOMOS'], vdims)
    heat = hv.HeatMap(ds)
    heat.opts(title_format=str(etos))
    heatmaps.append(heat)

layout = heatmaps[0] + heatmaps[1]
layout.opts(opts.HeatMap(width=500, height=600, tools=['hover'], colorbar=True, toolbar='above', xrotation=45))
hv.save(layout, 'test.html')

Does someone knows a way when I hover over a cell in the first heatmap to show tooltips and in the corresponding cell in the second one?

enter image description here

Thanks in advance.

bigreddot
  • 33,642
  • 5
  • 69
  • 122
  • this doesn't answer the question, but you can show data from both plots in the same tooltip as an alternative. – Seb May 26 '19 at 05:03
  • if it isn't much to ask, could you guide me where to look (an example or something) – Ignatios Chatzidiamantis May 26 '19 at 07:34
  • First of all, pass your `vdims` as a list, not tuple, of you want both of them to show up in the hover tooltip. I have no idea why that is so, maybe there's a good reason for the behaviour, but might be worth opening an issue to investigaten because it's somewhat unintuitive. – doppler May 28 '19 at 13:35
  • Second, I assume that to make a simultaneous hover in both plots, if it is at all possible, will require you to go deep into bokeh, I've never seen that behaviour exposed in holoviews. So it may be worth asking the question with a minimal example in the bokeh discourse channel. – doppler May 28 '19 at 13:39

0 Answers0