使用 gnuplot 动画单个数据文件

Animating a single data file using gnuplot

我使用 FORTRAN 77 代码生成包含 x-y 坐标的简单物理情况的数据(保存为 filename.dat),例如弹丸。

我的数据文件通常有 2 或 3 列,如下所示:

1 1
2 2
3 3
4 4
5 5

我可以很好地使用 Gnuplot 绘制(2d 和 3d),但我想为该点设置动画并使其看起来像图形上的真实弹丸,然后将其保存为 .gif 文件。

我是 bash 脚本的新手,所以请假设我对脚本一无所知,如果涉及使用脚本的话。

谢谢!

问题已解决。这是我使用的代码:

set terminal gif animate delay 100
set output 'output.gif'
stats 'data.dat' nooutput
set xrange [-0.5:1.5]
set yrange [-0.5:5.5]

do for [i=1:int(STATS_blocks)] {
   plot 'data.dat' index (i-1) with circles
}

此功能需要 Gnuplot 4.6 或更高版本。必须在 gnuplot 中输入此代码。这要求数据采用以下格式:

1 1


2 2


3 3


4 4