using Plots
function plot_frame(angle)
scatter(
[cos(angle)],
[sin(angle)],
ratio=:equal,
xlims=(-1.5, 1.5), ylims=(-1.5, 1.5),
legend=:none)
end
plot_frame (generic function with 1 method)
anim = Animation()
Animation("/tmp/jl_VgDi2o", String[])
for angle in 0:0.05:pi
plt = plot_frame(angle)
frame(anim, plt)
end
anim
Animation("/tmp/jl_VgDi2o", ["000001.png", "000002.png", "000003.png", "000004.png", "000005.png", "000006.png", "000007.png", "000008.png", "000009.png", "000010.png" … "000054.png", "000055.png", "000056.png", "000057.png", "000058.png", "000059.png", "000060.png", "000061.png", "000062.png", "000063.png"])
gif(anim)
┌ Info: Saved animation to │ fn = /home/diego/Documents/Book/Interactive-Visualization-with-Julia/Chapter04/tmp.gif └ @ Plots /home/diego/.julia/packages/Plots/yfzIY/src/animation.jl:114
gif(anim, "first_animation.gif", fps=50, loop=-1)
┌ Info: Saved animation to │ fn = /home/diego/Documents/Book/Interactive-Visualization-with-Julia/Chapter04/first_animation.gif └ @ Plots /home/diego/.julia/packages/Plots/yfzIY/src/animation.jl:114