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

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:

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.

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.

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):

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!

I don’t think that’s right, you can listen to an event that is triggered when the mouse position changes. See Observables & Interaction · Makie Plotting Ecosystem

These examples might also help you get started: http://juliaplots.org/MakieReferenceImages/gallery/mouse_picking/index.html
http://juliaplots.org/MakieReferenceImages/gallery/mouse_hover/index.html

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!

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.

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