Draggable axis sliders in Julia

Viewed 189

enter image description here

I am trying to replicate this plot in Julia. The idea is to be able to drag the x-axis using a slider. The closest code that I found to replicate this is shown below:

## Interact.WebIO.install_jupyter_nbextension() # might be helpful if you see `WebIO` warnings in Jupyter
@manipulate throttle=.05 for λ=0:.1:5, μ=0:.1:5
    xs = range(0.0, 1.0, length = 100)
    Plots.plot(xs, x -> λ*x^2 + μ)
end

Is there any libraries that can do this easily? Thanks!

1 Answers

As folks mentioned in the comments, there's a few viable approaches to this. Interact.jl is definitely one of them. I would also suggest looking at Makie.jl: http://makie.juliaplots.org/stable/makielayout/slider.html which is a great tool for something like this and will solve your use case perfectly.

Related