使用gnuplot用数据文件制作电影 [英] Make movie with data files using gnuplot

查看:83
本文介绍了使用gnuplot用数据文件制作电影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实有很多数据文件。它们看起来像
1.dat
2.dat
....
....
1000.dat

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

我想使用这些文件按顺序绘制电影。
请问有人知道吗?
如果您能帮助我,那将是我的荣幸。
ND

I want to make a movie using these files plotting them in sequence. Does anyone have any idea please? It would be my great pleasure if you can help me. ND

推荐答案

您需要在此处执行两个步骤。第一个是从数据创建jpeg或png图。
我不知道您的数据是什么样子,但是我想您已经找到了如何使用gnuplot对其进行绘制。 Gnuplot有一个循环选项,但是如果您使用的是Linux系统,则可以轻松地将所有文件作为参数
传递给gnuplot,例如,在bash中运行以下命令:

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

编辑:
澄清后(数据为3d等):

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

的确是将需要完成的工作替换为您自己的命令。 gnuplot具有出色的功能,但是您需要准确告诉它该怎么做。这取决于您的数据以及所需的输出。我已经使用splot创建了 3d网格图

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.

这篇关于使用gnuplot用数据文件制作电影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆