Make a movie with data files using gnuplot

I have many data files. They are similar 1.dat 2.dat .... .... 1000.dat

I want to make a movie using these files, building them sequentially. Does anyone know please? It would be very nice if you could help me. Nd

+7
source share
1 answer

You need two steps. The first is to create jpeg or png graphics from data. I don’t know what your data looks like, but I think you have already figured out how to do it with gnuplot. Gnuplot has a loop option, but if you use a Linux module, you can easily pass all files to gnuplot as arguments, for example, run the following in bash:

for i in {1..1000} do gnuplot "What needs to be done" $i.dat done 

Now you need to create your own movie. The easiest way:

 ffmpeg -i gnuplotoutput%04d.jpeg movie.mpeg 

Edit: After clarification (3d data, etc.):

 for i in {1..1000} do gnuplot -e "set terminal jpeg; splot '$i.dat'" > pic$i.jpeg done ffmpeg -i pic%04d.jpeg movie.mpeg 

Indeed, the idea was that β€œwhat needs to be done” would be replaced by your own teams. gnuplot is exceptionally capable, but you need to tell you exactly what to do. It depends on your data and what you want. I used splot to create a 3d grid graph .

+9
source

All Articles