Hi, someone could help me to plot a graph that show the function value under the cursor?
For example in the image below if the black point is cursor it will show (-0.5,2)
Tks
Hi, someone could help me to plot a graph that show the function value under the cursor?
For example in the image below if the black point is cursor it will show (-0.5,2)
Tks
If you are using IJulia, then you can do this with Plots.jl and plotly:
using Plots
plotly()
plot(linspace(-1, 1).^2)
And if you’re using Plots with Juno, the plotlyjs()
backend will do it. Just swap out that plotly()
command. And if you’re at the REPL, plotlyjs()
will give you a GUI window with that interactivity, while plotly()
will open it in a browser.
The InspectDR
backend was built with this kind of interactivity in mind:
InspectDR.jl
: GitHub - ma-laforge/InspectDR.jl: Fast, interactive Julia/GTK+ plots (+Smith charts +Gtk widget +Cairo-only images)
Eventually, the intent was to have the cursor track the plot data so that all displayed coordinates are meaningful, but for now, all features are “floating” in the plot window.
Plots.jl
:julia> Pkg.checkout("Plots")
Just remember to eventually restore Plots.jl to its most recent “tagged” version once Tom (the maintainer of Plots.jl) creates a new release:
julia> Pkg.free("Plots")
Would it be possible to read out the cursor positions (x,y) which are displayed in the active PyPlot-window in order to use the values for further tasks? And how can I manage this?