如何修复';' gnuplot中的预期错误

时间:2014-08-07 12:13:32

标签: gnuplot

我使用的是ubuntu 14.04,gnuplot 4.6 patchlevel 4.
我有以下脚本,名为Plot.script:

## GNUPLOT command file
set terminal postscript color
set style data lines
set noxzeroaxis
set noyzeroaxis
set key top spacing .8
set size ratio 0.821894871074622
set noxtics
set noytics
set title 'Combined DET Plot'
set ylabel 'Miss probability (in %)'
set xlabel 'False Alarm probability (in %)'
set grid
set pointsize 3
set ytics (\
    '5' -1.6449, '10' -1.2816, '20' -0.8416, '40' -0.2533, '60' 0.2533, \
    '80' 0.8416, '90' 1.2816, '95' 1.6449, '98' 2.0537)
set xtics (\
    '.0001' -4.7534, '.001' -4.2649, '.004' -3.9444, '.01' -3.7190, '.02' -3.5401, \
    '.05' -3.2905, '.1' -3.0902, '.2' -2.8782, '.5' -2.5758, '1' -2.3263, \
    '2' -2.0537, '5' -1.6449, '10' -1.2816, '20' -0.8416, '40' -0.2533)
plot [-4.75343910607888:-0.253347103317183] [-1.64485362793551:2.05374890849825] \
   -x title 'Random Performance' with lines 1,\
  'tmp/score.det.sub00.dat.1' using 3:2 title 'Term Wtd. fake : ALL Data Max Val=0.267         Scr=0.436' with lines 2,\
  'tmp/score.det.sub00.dat.2' using 6:5 notitle with points 2,\
  'tmp/score.det.sub01.dat.1' using 3:2 title 'Term Wtd. fake: CTS Subset Max Val=0.267     Scr=0.436' with lines 3,\
  'tmp/score.det.sub01.dat.2' using 6:5 notitle with points 3

然后我运行gnuplot Plot.script | ps2pdf - 。
我收到以下错误:

line 27: ';' expected

第27行是脚本的最后一行:

'tmp/score.det.sub01.dat.2' using 6:5 notitle with points 3

我在网上搜索过并找到this similar question,但似乎没有帮助。有谁知道问题是什么?

1 个答案:

答案 0 :(得分:2)

通常,调试这么长的脚本非常困难,尤其是在没有测试数据来运行这个脚本的情况下。您应该首先逐行减少脚本,以追踪错误确实出现在哪一行。整个plot命令被视为一行,因此如果它显示为line 27,则错误也可以更早出现。

我猜,您选择线型的语法错误。使用with lines 1不起作用,而简单的行

plot x with lines 1

已经显示此错误。你必须使用

plot x with lines linetype 1

因此,您必须修复设置线型(或点类型)的所有其他位置。

相关问题