【问题标题】:Gnuplot wouldn't reset (GIF)Gnuplot 不会重置 (GIF)
【发布时间】:2016-04-13 03:51:50
【问题描述】:

它应该重置并制作动画。 我已经尝试了其他以前帖子中的所有建议,但我仍然有这个结果。

我的 datei.dat 有 4 列,每个块用空行分隔。

set autoscale
set datafile seperator ","
plot "datei.dat" index (i) u 1:2 t '1:2' with linespoints ,\
   "datei.dat" index (i) u 1:3 t '1:3' with linespoints ,\
   "datei.dat" index (i) u 1:4 t '1:4' with linespoints 
replot
pause 1
i = i + 1
if(i<N) reread

动画.plt

reset
set term gif animate
set terminal gif animate delay 50
set output "plotalive.gif"
N = int(STATS_blocks)
i = 0
load "animate.plt"
set output

循环.plt

【问题讨论】:

  • 您希望在哪个阶段重置什么?请更具体。
  • 制作动图,需要libgd支持。来自help gifThe animate option is available only if your local gd library supports the creation of animated gifs。试试set term gif animate; set out "test.gif"; do for [n=0:10] {plot sin(x*n) w l}; set out
  • @bibi 我已经检查并确认我已经安装了 libgd。你的脚本也在我的电脑上运行。尽管如此,我还是无法将它应用到我的工作中。

标签: animation plot gnuplot gif


【解决方案1】:

如果 n 是块的大小,你应该使用 every。 索引用于分隔数据集(两个空行)。

以下是避免重读可能要做的事情(可能会进行一些更改):

set terminal dummy
plot "datei.dat"
N = int(STATS_blocks)

set terminal gif animate delay 50
set output "plotalive.gif"

set autoscale
set datafile seperator ","

do for [i=0:N] {
plot "datei.dat" u 1:2 every ::i::i t '1:2' with linespoints ,\
   "" u 1:3 every ::i::i t '1:3' with linespoints ,\
   "" u 1:4 every ::i::i t '1:4' with linespoints 
}
set output

【讨论】:

    猜你喜欢
    • 2020-11-04
    • 1970-01-01
    • 2020-09-12
    • 2014-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多