做一个动画在gnuplot的命令1 [英] Do an animation in 1 command in gnuplot
问题描述
我试图用展示的gnuplot动画
我得到了下面的脚本:
I'm trying to show an animation using gnuplot I got the following script:
plot "heat1d.txt " using 1:2 every :::a::a
pause 0.01
a=a+1
if ( a<b ) reread
这是我执行使用
a = 0
b = 100
load "a.plot"
它的工作原理,但有只使用1个命令从shell执行这一切的方法吗?
或者是那里的变量定义融入.plot文件,这样我可以简单地执行它的方法吗?我试着像不同的东西的回声A = 0'| gnuplot的
等,但它似乎并没有真正正确定义变量
it works, but is there a way to execute all of this using only 1 command from a shell?
Alternatively is there a way to integrate the variable definitions into the .plot file so that I can simply execute it? I tried different things like echo 'a=0'|gnuplot
etc but it doesn't seem to actually define the variable correctly
感谢
推荐答案
您可以使用一个do for循环。
You can use a do for loop.
do for [a = 0:100] {
plot "heat1d.txt " using 1:2 every :::a::a
pause 0.01
}
Linux上的默认终端通常是维先通
,它具有筹集
选项,这将改变焦点在每次迭代绘图窗口。这将使它很难甚至无法停止动画。
The default terminal on linux is usually wxt
, and it has the raise
option, which will change the focus to the plot window at every iteration. This will make it difficult if not impossible to stop the animation.
我建议把 noraise
作为终端选项。例如,你可以把下面一行在脚本的开头:
I suggest to put noraise
as the terminal option. For example, you can put the following line at the beginning of the script:
set term wxt noraise
现在,如果你想停止动画中途,preSS <大骨节病>控制骨节病> <大骨节病> C 骨节病>的gnuplot的终端上。
Now, if you want to stop the animation halfway, press CtrlC on the gnuplot terminal.
这篇关于做一个动画在gnuplot的命令1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!