从单个文件在Gnuplot中创建gif [英] Create a gif in Gnuplot from a single file

查看:96
本文介绍了从单个文件在Gnuplot中创建gif的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很长的文件,如下所示(我只是在编写示例)

I have a long file like the following (I am just writing a sample)

0.0 0.00209627946771 6483.0 3092622.0 1100
0.1 0.00253798848144 78.0 30733.0 1100
0.2 0.0174927113703 6.0 343.0 1100
0.3 0.0 0.0 35.0 1100
0.4 0.1 1.0 10.0 1100
0.5 0.0 0.0 4.0 1100
0.9 0.0 0.0 1.0 1100
1.0 0.0 0.0 2.0 1100
0.0 0.00292927058349 9057.0 3091896.0 2100
0.1 0.00299136583044 88.0 29418.0 2100
0.2 0.00743889479277 14.0 1882.0 2100
0.3 0.00578034682081 2.0 346.0 2100
0.4 0.0172413793103 2.0 116.0 2100
0.5 0.030303030303 1.0 33.0 2100
0.6 0.0 0.0 11.0 2100
0.7 0.0 0.0 10.0 2100
0.8 0.0 0.0 11.0 2100
0.9 0.181818181818 2.0 11.0 2100
1.0 0.0 0.0 16.0 2100
0.0 0.00318549549582 9845.0 3090571.0 3100
0.1 0.00273270708796 80.0 29275.0 3100
0.2 0.00489168413697 14.0 2862.0 3100
0.3 0.00810372771475 5.0 617.0 3100
0.4 0.010101010101 2.0 198.0 3100

我要绘制的数据是第一列和第二列.在第5列中有我的模拟时间(这是与不同时间戳有关的信息).

The data I am interested to plot are the first and second column. In the 5th column there is the time of my simulation (it is the information related to the different timestamp).

中获取灵感:用gnuplot创建gif:Gif不会播放我想写类似

set terminal gif size 1000,800 animate delay 6
set output 'try.gif'

set xrange [0:1]
set yrange [0:1]

do for [i=100:40200:100] {
 ....
}

但是我不知道如何指示gnuplot数据的第i个块由最后一列给出.有什么建议吗?

but I have no idea to how indicate to gnuplot that the i-th block of data is given by the last column. Any suggestions?

推荐答案

似乎时间戳是等距的.然后,您可以尝试执行以下操作:

It seems that the timestamps are equidistant. Then you can try something like the following:

set terminal gif size 1000, 800 animate delay 100
set output 'try.gif'

# Viewing the 3D plot from top imitates a 2D plot.
set view map

set xlabel "x"
set ylabel "y"

do for [i=1100:3100:1000] {
  # Only points at time "i" are plotted.
  set zrange [i-1:i+1]
  set title "Time: ".i
  splot "data.dat" using 1:2:5 w lp
} 

在Debian Linux上使用Gnuplot 4.6进行了测试.我并不关心性能一遍又一遍地读取整个文件.

Tested with Gnuplot 4.6 on Debian Linux. I did not care about performance reading the whole file again and again.

运行脚本会生成此

这篇关于从单个文件在Gnuplot中创建gif的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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