In [1]:
using Plots
gr();
n = 20;
anim = @animate for i in 1:n
    plot(sin,cos,-pi,pi,label="",aspect_ratio=1);
    scatter!(
        [ exp(2*pi*im*t/i) for t in 1:i],
        title="$i-th roots of 1",
        label=""
    )
end
gif(anim,"roots.gif",fps=1)


INFO: Saved animation to /Users/tauu/Documents/Work/Reise/Vancouver2017/JuliaCourse/roots.gif
Out[1]:

In [2]:
Pkg.add("Interact")


INFO: Cloning cache of Interact from https://github.com/JuliaGizmos/Interact.jl.git
INFO: Installing Interact v0.6.0
INFO: Installing Reactive v0.6.0
INFO: Building Interact
WARNING: Compat.AsyncCondition is deprecated, use Base.AsyncCondition instead.
  likely near /Users/tauu/.julia/v0.6/Interact/deps/build.jl:39
WARNING: Compat.AsyncCondition is deprecated, use Base.AsyncCondition instead.
  likely near /Users/tauu/.julia/v0.6/Interact/deps/build.jl:39
INFO: Enabling widgetsnbextension
Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: OK
INFO: ipywidgets version found: 6.0.0
INFO: A compatible version of ipywidgets was found. All good.
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Interact
INFO: Use `Pkg.update()` to get the latest versions of your packages

In [5]:
using Interact
@manipulate for i in 1:n
    plot(sin,cos,-pi,pi,label="",aspect_ratio=1);
    scatter!(
        [ exp(2*pi*im*t/i) for t in 1:i],
        title="$i-th roots of 1",
        label=""
    )
end


INFO: Precompiling module Interact.
Out[5]:
-1.0 -0.5 0.0 0.5 1.0 -1.0 -0.5 0.0 0.5 1.0 10-th roots of 1 Re(x) Im(x)

In [ ]: