Ubuntu 关于我的gnuplot版本和我的终端

Ubuntu 关于我的gnuplot版本和我的终端,ubuntu,plot,gnuplot,gif,Ubuntu,Plot,Gnuplot,Gif,我想制作一个gif文件,对名为1.dat、2.dat的文件进行迭代。。。我已尝试使用以下代码: !/usr/bin/gnuplot unset key plot "dades.dat" using 1:2 # h=GPVAL_DATA_Y_MIN #1.69794089321728966E-045 # plot "dades.dat" using 1:3 #------>Dummy plot

我想制作一个gif文件,对名为1.dat、2.dat的文件进行迭代。。。我已尝试使用以下代码:

!/usr/bin/gnuplot

unset key 

plot "dades.dat" using 1:2                      #

h=GPVAL_DATA_Y_MIN #1.69794089321728966E-045    #

plot "dades.dat" using 1:3                      #------>Dummy plots per tal de guardar en 
variables

d=GPVAL_DATA_Y_MIN #7.12168589558569665E-046    #          els valors ses amplades de ses malles

plot "dades.dat" using 1:4                      #

c=GPVAL_DATA_Y_MIN                              #

plot "dades.dat" using 1:5                      #

lam=GPVAL_DATA_Y_MIN                            #

plot "dades.dat" using 1:6                      #

n=GPVAL_DATA_Y_MIN                              #


i=0
set terminal gif      
unset key                        
set output "film.gif"
set title "V(x)"
set xlabel "x(m)"
set ylabel "V(V)"

i=i+1

if( i < n ) reread;
但是,当我执行时,终端会显示下一个错误页面:

do for [i=0:n] {
               ^
"./film.gnuplot", line 22: invalid complex constant
非常额外,因为我已经安装了4.6版本的gnuplot。然后我试着把终端放进gnuplot./film.gnuplot,然后显示:

set terminal gif      
             ^
"film.gnuplot", line 15: unknown or ambiguous terminal type; type just 'set terminal' for a list
最后,我执行gnuplot,编写帮助终端comand,并向我显示我已经安装了所有这些终端:

   canvas            cgm               context           corel
    dumb              dxf               eepic             emf
    emtex             epslatex          fig               gpic
    hp2623a           hp2648            hpgl              imagen
    latex             mf                mif               mp
    pcl5              pop               postscript        pslatex
    pstex             pstricks          push              qms
    regis             svg               tek40xx           tek410x
    texdraw           tgif              tkcanvas          tpic
    vttek             xterm
是非常额外的,因为我总是使用png终端,从不向我显示错误,但是当我使用gnuplot执行时,它会向我显示错误

我正在使用Ubuntu

对我来说,有效的方法如下。它不是很优雅。。我有一个第一个脚本'animar.gnu',我在其中加载gif终端,然后是第二个脚本来绘制循环'plot.gnu'。在第一个例子中:

    set terminal gif animate
    set output 'peli.gif'
    ii=1
    load 'plot.gnu'
    set terminal wxt
    set output
第二个是

    infile(ii) = sprintf("%d.dat",ii)
    plot infile(ii) u 1:2
    ii = 1 + ii
    if (ii<4) reread
infle(ii)=sprintf(“%d.dat”,ii)
填充图(ii)u 1:2
ii=1+ii

如果(ii)如果您运行
gnuplot--version
输出是什么?奇怪的是,正如您所说,您通常使用png终端,但它没有被列为已安装。您还可以在gnuplot中运行
print GPVAL_TERMINALS
,检查安装了哪些终端。感谢您的回答。如果我运行gnuplot--version,它会显示我有gnuplot4.6 patchlevel 5奇怪。您使用的是哪种操作系统?您是自己编译/安装gnuplot还是使用软件包?我看到的一件事是,您使用
I
作为循环计数器和变量,gnuplot抱怨
无效的复数常量
,可能是因为它试图使用
I
表示-1的平方根。试试看使用不同的变量名(例如,
ii
)。
i
意味着复杂常量的问题在许多语言中都很常见,因此不使用
i
j
作为变量是一个好习惯。我使用的是Ubuntu,我手动安装了gnuplot(直接从gnuplot网站下载,从终端开始安装)。关于变量的名称,我更改了它,但错误消息仍然显示出来。@andyras gnuplot使用符号
{0,1}
对于虚常数
i
。由于4.4版不知道
for
循环的执行方式,它希望在开始括号后有一个复数。感谢您的回答。我已经尝试过像您的示例那样执行此操作,但没有重新识别终端。我尝试过安装它,但我安装到了gnuplot的早期版本。谢谢。
    infile(ii) = sprintf("%d.dat",ii)
    plot infile(ii) u 1:2
    ii = 1 + ii
    if (ii<4) reread