@animate @gif using plots

532 views
Skip to first unread message

digxx

unread,
Aug 7, 2016, 1:03:33 PM8/7/16
to julia-users
Hey I reinstalled Julia and am now wondering why the animation part of plots doesnt work anymore. It did before...
I presume I'm lacking dependencies though which ones?

The following produces an error.

x=linspace(0,pi,100)
anim=@animate for i=0:100
y=sin(x*exp(i/50))
plot(x,y,xlims=(0,pi),ylims=(-1,1))
end
gif(anim, dirname(@__FILE__)*"\\anim.gif", fps=30)

and the error is :

Unzul▒ssiger Parameter - 3
WARNING: Tried to create gif using convert (ImageMagick), but got error: ErrorException("failed process: Process(`convert -delay 3 -loop 0 'C:\\cygwin64\\tmp\\jul28E7.tmp\\*.png' -alpha off 'C:\\Users\\Diger\\Documents\\Julia\\Plotting\\anim.gif'`, ProcessExited(4)) [4]")
ImageMagick can be installed by executing `Pkg.add("ImageMagick")`
Will try ffmpeg, but it's lower quality...)
ERROR: LoadError: could not spawn `ffmpeg -v 0 -framerate 30 -i 'C:\cygwin64\tmp\jul28E7.tmp/%06d.png' -y 'C:\Users\Diger\Documents\Julia\Plotting\anim.gif'`: no such file or directory (ENOENT)
 in _jl_spawn at process.jl:262
while loading C:\Users\Diger\Documents\Julia\Plotting\animation.jl, in expression starting on line 6

When I first used the animation thingy I also had this error. But this was fixed after adding ImageMagick...

Also now I do have ImageMagick installed and it seemed to have run through without any problems, still the error persists...

Tom Breloff

unread,
Aug 7, 2016, 1:56:23 PM8/7/16
to julia...@googlegroups.com
Did you restart julia after adding ImageMagick?  The errors are because it can't find either ImageMagick or ffmpeg, one of which is required to make gifs. 

digxx

unread,
Aug 7, 2016, 2:25:24 PM8/7/16
to julia-users
Yes I did and it still persists :-(
I added and removed various Packages to see if sth is missing (comparing to before)
but nothing works :-(
I removed and readded Imagemagick but that also didnt help.

digxx

unread,
Aug 7, 2016, 3:29:19 PM8/7/16
to julia-users
I just manually installed imagemagick and got the error:
julia> gif(anim,"C:\\Users\\Diger\\Documents\\Julia\\Plotting\\anim2.gif",fps=15)
Unzul▒ssiger Parameter - 7
WARNING: Tried to create gif using convert (ImageMagick), but got error: ErrorException("failed process: Process(`convert -delay 7 -loop 0 'C:\\cygwin64\\tmp\\jul20EA.tmp\\*.png' -alpha off 'C:\\Users\\Diger\\Documents\\Julia\\Plotting\\anim2.gif'`, ProcessExited(4)) [4]")
ImageMagick can be installed by executing `Pkg.add("ImageMagick")`
Will try ffmpeg, but it's lower quality...)
INFO: Saved animation to C:\Users\Diger\Documents\Julia\Plotting\anim2.gif
Plots.AnimatedGif("C:\\Users\\Diger\\Documents\\Julia\\Plotting\\anim2.gif")


So same error as before but apparent afterwards he still is able to use the installed version to convert it?
The .gifs look pretty weird though:

digxx

unread,
Aug 7, 2016, 3:58:09 PM8/7/16
to julia-users
Sorry again, not quite the same error:
He was using ffmpeg apparently. Though I got it working with convert now (after removing all the imagemagick packages from julia and with the manually installed stuff) what is remaining is the jumping legend also seen in the above uploaded gif.

digxx

unread,
Aug 7, 2016, 4:04:46 PM8/7/16
to julia-users
Is it possible to position the legend manually in a plot(x,y,leg_pos=???)

Tom Breloff

unread,
Aug 7, 2016, 5:06:45 PM8/7/16
to julia...@googlegroups.com
Something like 'legend = :topright' might work. 


On Sunday, August 7, 2016, digxx <diger...@hotmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages