Data Coordinates included in plot (Matlab calls it data tip)

It isn’t entirely clear to me from the question what you want:

  • Do you want to just annotate your plot?
julia> using Plots

julia> plot(rand(10), annotate = (5, 0.5, "my text here"))

image

  • Do you want to see (x,y) coordinates of a plot on mouse hover? This works e.g. with the Plotly backend for Plots.jl:
julia> using Plots; plotly()

julia> plot(rand(10))

image

  • Or do you want to be able to click on a point in your graph and have those coordinates labelled upon clicking? I don’t have an exact idea of how that would work, but I assume you’d have to write some custom code that allows for recording mouse click events - there’s an example of how to do it using PyPlot.jl here: Storing mouse click event coordinates in PyPlot window. Once you’ve recorded the mouse click event you can re-plot with an annotation added.
1 Like