# Extra hover columns for heatmap

**URL:** <https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828>\
**Category:** hvPlot\
**Created:** [September 19, 2021, 8:29pm UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828 "2021-09-19T20:29:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![isomerase](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/isomerase/32/2629_2.png) [@isomerase](https://discourse.holoviz.org/u/isomerase)\
**Post date:** [September 19, 2021, 8:29pm UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/1 "2021-09-19T20:29:31Z")

</div>

Hi

Is hover\_cols in hvplot.heatmap functional? It’s listed in the help, but nothing appears if I set it.

---

<div class="post-metadata">

**Author:** ![Marc](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/marc/32/24_2.png) [@Marc](https://discourse.holoviz.org/u/Marc)\
**Post date:** [September 20, 2021, 6:08am UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/2 "2021-09-20T06:08:30Z")

</div>

Hi @isomerase

Welcome to the community. Could you post a small, reproducible example? It would make it much easier to help. Thanks.

---

<div class="post-metadata">

**Author:** ![isomerase](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/isomerase/32/2629_2.png) [@isomerase](https://discourse.holoviz.org/u/isomerase)\
**Post date:** [September 20, 2021, 10:34am UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/3 "2021-09-20T10:34:40Z")

</div>

I’ll try put one together (my current example is with RNA seq data). Basically, I just want extra columns in the tooltip when hovering over a cell.

---

<div class="post-metadata">

**Author:** ![Material-Scientist](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/material-scientist/32/503_2.png) [@Material-Scientist](https://discourse.holoviz.org/u/Material-Scientist)\
**Post date:** [September 20, 2021, 6:31pm UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/4 "2021-09-20T18:31:08Z")

</div>

Here’s an easy way:

If you put your data into an xarray dataset like this:  
 ![image](https://discourse.holoviz.org/uploads/default/original/2X/2/203118e8fe07dbc4df2adb678cc6e9c513ad1eeb.png)

Just call hvplot.heatmap on it, and pass the x,y, and z dimensions. Then, you can pass a HoverTool with tooltips, in which you can specify which metric to display on hover.

```auto
xarr.hvplot.heatmap(
    'date','pair','sigma',cmap='fire',
    clabel='Realized Volatility (%)',responsive=True,
    tools=[
             HoverTool(
                tooltips = [
                    ( "Time (UTC)", "@date{%F}"),
                    ( "Pair", "@pair"),
                    ( "Realized Volatility (%)", "@sigma{0.00 a}"),
                ],
                formatters={
                    '@date':'datetime', # use 'datetime' formatter for 'date' field
                }
            )
    ]+["crosshair"]
).opts(min_height=300,xaxis=None,clipping_colors={'NaN':'black'}).sort(by='pair',reverse=True,)

```

Output:

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/7/7e91ef6ee16b5a9b60731bfa929dbc26a86aa995.jpeg)

---

<div class="post-metadata">

**Author:** ![isomerase](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/isomerase/32/2629_2.png) [@isomerase](https://discourse.holoviz.org/u/isomerase)\
**Post date:** [September 20, 2021, 8:40pm UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/5 "2021-09-20T20:40:47Z")

</div>

So I figured out part of the problem. I was generating a heatmap based on a `.copy()` subset of columns without supplying `x` and `y`. Doing that gets the graph I want, but stupidly I forgot I was dropping the columns I want to use for `hover_cols`. But it seems you can’t supply of list of columns you want to use for `x` from the main pandas dataframe in `.heatmap()`.

Is there a way to generate a heatmap like this:  
 ![image](https://discourse.holoviz.org/uploads/default/original/2X/1/1abd54254dc805976a2193c3263af70f64ae2108.png)  
by specifying what columns to use on the x-axis while keeping the whole dataframe, letting me pass other columns to `hover_cols`?

---

<div class="post-metadata">

**Author:** ![isomerase](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/isomerase/32/2629_2.png) [@isomerase](https://discourse.holoviz.org/u/isomerase)\
**Post date:** [September 21, 2021, 11:42pm UTC](https://discourse.holoviz.org/t/extra-hover-columns-for-heatmap/2828/6 "2021-09-21T23:42:50Z")

</div>

So now I’m trying to modify the underlying libraries to accept a subset of columns, but it’s not as trivial as I thought. If I try to control for x being a list of columns, I don’t understand where the call to `base.py` comes from.

 ![image](https://discourse.holoviz.org/uploads/default/original/2X/c/c93344d9312aacc97fe7d0babb318c4eb59294ef.png)
