Custum DataInspector display-value [Makie]

I have a scatterplot, showing the time-evolution of some neural networks (x-axis = time) against performance (y-axis = performance). Each network has an ID. It would be fantastic if I could get the network ID (which I would supply for each datapoint, as a vector) when hovering a datapoint, and not the x and y coordinate.

Is it possible to show a custom set of values when hovering over datapoints, as opposed to the coordinates, using the DataInspector type?

See Inspector + line label · Issue #1759 · JuliaPlots/Makie.jl · GitHub

If you just want the IDs it might be easier to write your own inspector. For scatter plots the index returned by pick directly matches the index in the position array that matches the marker position. Assuming your ID’s are sorted the same way, you can use that to get the right ID and show it as a text plot. (The new event docs should helpful for this, though there a bunch of methods used with fig or ax that only accept scenes in the current Makie version.)

1 Like