# \[Plots.jl\] Can't show data on hover (surface plot)

**URL:** <https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397>\
**Category:** Visualization\
**Tags:** plotting, plots, plotlyjs\
**Created:** [March 3, 2021, 11:10am UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397 "2021-03-03T11:10:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [March 3, 2021, 11:10am UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/1 "2021-03-03T11:10:05Z")

</div>

Hello!

# My problem

For my application, I need to be able to obtain data points when hovering over a surface plot. As far as I know:

- `Makie` has no backend that supports this feature
- In `Plots`, there are two backends that allow this: Plotly (or PlotlyJS) and PyPlot.

Here is a MWE for both backends:

```julia
using Plots
plotly() # pyplot()

a = 1:0.1:20;
b = 5:0.05:10;
c = [x*log10(y) for x in a, y in b]

plot(a,b,c',seriestype=:surface)

```

# `Plotly`

When I try to use `Plotly` (or `PlotlyJS`) for this, I manage to print the surface, but no data is shown when hovering over the surface with the mouse. This situation does not change if I toggle on and off the button _Toggle show closest data on hover_.

 ![Plotly](https://global.discourse-cdn.com/julialang/original/3X/a/b/ab6b8be8feb4144658533bf14e11ff550c839112.png)

As you can see in the image, the point is found (there are axes across the surface to the point where the mouse is) but there is no “datatip” showing the coordinates. I know that this is possible using this backend because [the original documentation shows an example of it in the web.](https://plotly.com/python/3d-surface-plots/#topographical-3d-surface-plot)

# `PyPlot`

Same thing happens, but in the case of `PyPlot` the coordinates should be in the upper-right corner. It looks empty in the image (signaled with a big black arrow):

 ![PyPlot](https://global.discourse-cdn.com/julialang/original/3X/7/5/756a08588082d498a11e6c5cb3e8c2632e0b700c.png)

# Final thoughts

I hope you can help me, this is the final step I need in order to transition from MATLAB to Julia. In MATLAB plotting was usually easier, but I find it worth it to “suffer” this part of Julia while it improves, the rest of it is awesome.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 4, 2021, 7:00pm UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/2 "2021-03-04T19:00:16Z")

</div>

> [@nandoconde](#):
>
> `Makie` has no backend that supports this feature

I don’t think that’s right, you can listen to an event that is triggered when the mouse position changes. See [https://makie.juliaplots.org/stable/interaction.html#Mouse-Interaction](https://makie.juliaplots.org/stable/interaction.html#Mouse-Interaction)

These examples might also help you get started: [http://juliaplots.org/MakieReferenceImages/gallery/mouse\_picking/index.html](http://juliaplots.org/MakieReferenceImages/gallery/mouse_picking/index.html)  
[http://juliaplots.org/MakieReferenceImages/gallery/mouse\_hover/index.html](http://juliaplots.org/MakieReferenceImages/gallery/mouse_hover/index.html)

---

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [March 4, 2021, 7:16pm UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/3 "2021-03-04T19:16:34Z")

</div>

Thanks a lot! I did know about Observables, but I was not aware that it was possible to do this with them.

I am tempted to mark your answer as “Solution”, but as this is still a problem with `Plots` and people may be looking for a solution with them, I will leave it unmarked for a day. If nobody peeps in, I will mark it.

Thank you again!

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 4, 2021, 7:26pm UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/4 "2021-03-04T19:26:55Z")

</div>

> [@nandoconde](#):
>
> I am tempted to mark your answer as “Solution”

There’s no hurry! I don’t think people are generally too sensitive about who’s answer gets marked as solution on this forum (there’s no reputation system like on stackoverflow). Though it can probably help readers find a good answer.

---

<div class="post-metadata">

**Author:** ![nandoconde](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nandoconde/32/19497_2.png) [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Post date:** [March 9, 2021, 4:48pm UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/5 "2021-03-09T16:48:44Z")

</div>

Up, maybe anyone can help to get this with Plots…

---

<div class="post-metadata">

**Author:** ![Gravlax](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Post date:** [April 13, 2023, 8:59am UTC](https://discourse.julialang.org/t/plots-jl-cant-show-data-on-hover-surface-plot/56397/6 "2023-04-13T08:59:18Z")

</div>

Hello,  
I’m not sure wether this answers your question. For a a simple visual inspection, Plots with plotlyjs backend does support mouse hovering, even with your example:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/e/def94f82f496173ab453c7f1308caa19dc4ea076.png)
