# Click scatter overlayed on image to show scatter info

**URL:** <https://discourse.holoviz.org/t/click-scatter-overlayed-on-image-to-show-scatter-info/3048>\
**Category:** HoloViews\
**Created:** [November 7, 2021, 4:27pm UTC](https://discourse.holoviz.org/t/click-scatter-overlayed-on-image-to-show-scatter-info/3048 "2021-11-07T16:27:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxdawn](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/zxdawn/32/2325_2.png) [@zxdawn](https://discourse.holoviz.org/u/zxdawn)\
**Post date:** [November 7, 2021, 4:27pm UTC](https://discourse.holoviz.org/t/click-scatter-overlayed-on-image-to-show-scatter-info/3048/1 "2021-11-07T16:27:05Z")

</div>

Hi, I’m trying to overlay scatter on image and only click to show the info, instead of using hover.

![ezgif.com-gif-maker (1)](https://discourse.holoviz.org/uploads/default/original/2X/f/f3925d2d09f53f0299107b23847f4bbb41190d9b.gif)

Here’s the code of simple hover version:

```auto
import numpy as np
import pandas as pd
import holoviews as hv
from bokeh.models import HoverTool

data = np.random.rand(6, 4)
df_test = pd.DataFrame(data, columns=list("ABCD"))

tooltips = [
    ('x', '$x'),
    ('y', '$y'),
    ('z', '@image'),
]

hover = HoverTool(tooltips=tooltips)
image = hv.Image(data).opts(tools=[hover], cmap='gray')

tooltips = [
    ('x', '@A'),
    ('y', '@B'),
]

hover = HoverTool(tooltips=tooltips)
scatter = hv.Scatter(df_test, 'A', 'B').opts(size=10, tools=[hover])

image*scatter

```

![ezgif.com-gif-maker (1)](https://discourse.holoviz.org/uploads/default/original/2X/b/b100f3109a6e1bc728d80e560825e31c4d764837.gif)

This feature is also useful when there’re many closed scatters for hover tool to show. We can zoom in and click to show the info.

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [November 8, 2021, 4:54pm UTC](https://discourse.holoviz.org/t/click-scatter-overlayed-on-image-to-show-scatter-info/3048/2 "2021-11-08T16:54:53Z")

</div>

If you don’t mind it on the side:

> [@Example of using holoviews TapStream with Panel](https://discourse.holoviz.org/t/example-of-using-holoviews-tapstream-with-panel/166):
>
> is there an example of using holoviews TapStream and panel? or something similar to using any stream and panel

Else, I think you need to create a custom tool.  
[https://docs.bokeh.org/en/latest/docs/user\_guide/extensions\_gallery/tool.html?highlight=custom](https://docs.bokeh.org/en/latest/docs/user_guide/extensions_gallery/tool.html?highlight=custom)

---

<div class="post-metadata">

**Author:** ![ahuang11](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ahuang11/32/4947_2.png) [@ahuang11](https://discourse.holoviz.org/u/ahuang11)\
**Post date:** [November 8, 2021, 6:34pm UTC](https://discourse.holoviz.org/t/click-scatter-overlayed-on-image-to-show-scatter-info/3048/3 "2021-11-08T18:34:35Z")

</div>

There’s also [https://github.com/bokeh/bokeh/issues/5724](https://github.com/bokeh/bokeh/issues/5724)
