【问题标题】:gif animation creation with gnuplot, using a single file with keeping previous data on the plot使用 gnuplot 创建 gif 动画,使用单个文件并在绘图上保留以前的数据
【发布时间】:2016-12-06 16:58:00
【问题描述】:

这个问题在几个地方得到了部分回答,例如 Create a gif in Gnuplot from a single file

但有一个问题,提供的答案将仅在每个索引处绘制点。

假设我有以下数据集:

0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0


0 0 0 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0

我创建 gif 的代码是:

set terminal gif animate delay 50
set output 'foobar.gif'
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 ps 1.5
stats 'Datafile' nooutput
do for [i=1:int(STATS_blocks)] {
   splot  'Datafile' index (i-1) matrix with p ls 1
}

此代码将生成一个仅包含每个索引数据的 gif。而我希望将第二个数据集添加到第一个动画中。

我该怎么做?

【问题讨论】:

  • 你不能用 gnuplot 做到这一点。您必须先使用不同的程序预处理您的数据。

标签: gnuplot


【解决方案1】:

好吧,我自己设法找到了答案,抱歉@Christoph,最简单的答案总是删除问题。是的,可以添加第二个循环。我知道我需要添加第二个循环,但我不确定如何:

set terminal gif animate delay 50
set output 'foobar.gif'
set grid
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt 7 ps 1.5
stats 'Datafile' nooutput
set ztics 1
set zrange [-2:7]
do for [i=1:int(STATS_blocks)] {
   splot for [j=1:i] 'Datafile' index (j-1) matrix  notitle with p ls 1
}

这将产生我想要的。

【讨论】:

  • 好吧,那我对你的问题也有了不同的理解。我以为你的意思是“加”,意思是对块 1...i 求和。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-08-25
  • 1970-01-01
  • 2012-06-25
  • 2018-01-16
  • 1970-01-01
  • 2017-06-13
  • 2020-05-13
相关资源
最近更新 更多