JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
525 stars 76 forks source link

slider doesn't control plot with using LinearAlgebra #391

Closed johnfgibson closed 3 years ago

johnfgibson commented 3 years ago

In Jupyter the following code produces a slider and a plot, but the plot doesn't change as I move the slider. It stays frozen showing the plot for the mid value r=5.

using Interact, Plots, LinearAlgebra

@manipulate throttle = 0.05 for r = 0:0.5:10
    x = 0.0:0.01:1.0
    plot(x, sin.(r*x), ylim=(-1,1))
end

But if I remove , LinearAlgebra from the using statement, the lot and slider behave correctly. And it all works correctly if I load LinearAlgebra after making the first interactive plot.

Julia 1.5.1, IJulia 1.21.3, Interact 0.10.3, Plots 0.28.4, WebIO 0.8.15, openSUSE 15.2 linux

johnfgibson commented 3 years ago

Hmm, somethign is more complex or stranger than I had supposed. Sometimes my sliders work, sometimes they don't, using the exact same code with a fresh Julia kernel, fresh chrome, and the above code executed in cell 1 of the notebook. I'll close this issue and post another if I narrow it down to something not my fault!