开发者

Make movie with data files using gnuplot

I do have many data files. They look like 1.dat 2.dat .... .... 1000.dat

I want to make a movie using these files plotting them in sequence. Does anyone have any idea please? It would be my g开发者_开发百科reat pleasure if you can help me. ND


You need two steps here. The first one is to create jpeg or png plots from the data. I do not know what your data looks like, but I guess you've already found out how to plot it with gnuplot. Gnuplot has a loop option, but if you're on a linux box, you can easly pass all the 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 movie. The easiest way would be:

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

Edit: After your clarification (the data is 3d 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 " will be replaced by your own commands. gnuplot is exceptionally capable, but you need to tell it exactly what to do. That depends on your data, and what output you want. I've used splot, to create a 3d grid graph.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜