我使用FORTRAN 77代码生成包含xy坐标(如抛射物)的简单物理场景的数据(保存为filename.dat).
我的数据文件通常有2或3列,如下所示:
1 1
2 2
3 3
4 4
5 5
Run Code Online (Sandbox Code Playgroud)
我可以使用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
}
Run Code Online (Sandbox Code Playgroud)
为此,需要使用Gnuplot 4.6或更高版本.必须在gnuplot中输入此代码.这要求数据采用以下格式:
1 1
2 2
3 3
4 4
Run Code Online (Sandbox Code Playgroud)