http://www.gnuplotting.org/animation-gif/ Animation I – gif October 21st, 2011 | 6 Comments For presentation or teaching purposes it can be useful to show not only a figure, but an animation to illustrate something more clear. There exists different possibilities to do this in Gnuplot. Today we will have a look at how to create a gif animation. Fig. 1 Animation of Bessel function ( code to produce this figure , loop ) Fig. 1 shows a gif animation of a Bessel function of first kind and zeroth order. Gnuplot has a gif output terminal, but the result will be smoother if we first create png files with Gnuplot and then the animated gif file with another program. In order to create a set of png files we have to loop through the time value t and different output files. # initializing values for the loop and start the loop t = 0 end_time = 1 system ( 'mkdir -p animation' ) load 'bessel.plt' The above code sets a start value for the running time variable t and the end_time variable at which the looping should be stopped. Then a folder for the output png files is created and the loop file bessel.plt is loaded. The content of this loop file is shown below. # bessel loop t = t + 0.02 outfile = sprintf ( 'animation/bessel%03.0f.png' , 50 * t ) set output outfile splot u * sin ( v ), u * cos ( v ), bessel ( u , t ) w pm3d ls 1 if ( t end_time ) reread ; Here we update the time t, create a file name with a different number and plot out Bessel function. Finally the last line checks if our time t is smaller than the end_time variable, and executes the loop again if this is the case. After we have created the png files in the animation folder, we start GIMP and load all the files as layers (File Open as Layers). After this we save all layers together as an animated gif file. Tags: animation , bessel , gif , if , load , reread 6 Comments Fabian says: March 7, 2012 at 1:19 pm Amazing. Thank you very much for this article and the whole website. I’m absolutely fascinated of what you can get out of gnuplot. Thanks for sharing this knowledge with us. Sijo says: March 19, 2012 at 5:19 pm Thank you for sharing the information.. Physicist’s rocks !!! I am trying to make an animation using GNU plot timeout says: January 10, 2013 at 3:21 am cool, thanks for the info on the gif animations and the great site ! even this is a nice one: add following line to the end of your script..although this requires imagemagick to be installed. system(‘convert -delay 10 -loop 0 animation/*.png animation/ani.gif’) hagen says: January 10, 2013 at 4:07 am Thanks, this is indeed a nice one and gives you the same result as with GIMP. Nicolas says: March 5, 2013 at 7:37 am I’ve been trying to do this with gnuplot 4.4 and I can’t get it. It only works with 4.6 ?? hagen says: March 5, 2013 at 8:48 am I have tested it with gnuplot 4.4.3, and 4.4.2. It both worked. With gnuplot 4.6 you can do it in an easier way, see Animation IV – trajectory .