Can you update a plot in Julia?

The Plots.jl documentation includes an example of an animation:

http://docs.juliaplots.org/latest/examples/gr/#functions-adding-data-and-animations

There are more details in the documentation, but I included a copy of the sample code here:

p = plot([sin, cos], zeros(0), leg=false)
anim = Animation()
for x = range(0, stop=10π, length=100)
    push!(p, x, Float64[sin(x), cos(x)])
    frame(anim)
end

I myself posted an example on how to do this directly with the InspectDR package (for faster refresh rates):

1 Like