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

如何修复'';gnuplot中的预期错误,gnuplot,Gnuplot,我使用的是ubuntu 14.04,gnuplot 4.6补丁级别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 t

我使用的是ubuntu 14.04,gnuplot 4.6补丁级别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
'tmp/score.det.sub01.dat.2' using 6:5 notitle with points 3
然后运行gnuplot Plot.script | ps2pdf-。
我得到以下错误:

line 27: ';' expected
第27行是脚本的最后一行:

## 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
'tmp/score.det.sub01.dat.2' using 6:5 notitle with points 3

我在网上搜索了一下,找到了,但似乎没什么帮助。有人知道问题出在哪里吗?

一般来说,调试这么长的脚本非常困难,尤其是没有测试数据来运行这个脚本。您应该从逐行删减脚本开始,以跟踪错误真正出现在哪一行。整个
绘图
命令被视为一行,因此,如果显示
第27行
,则错误也可能出现得更早

我猜,您在选择线型时使用了错误的语法。对第1行使用
不起作用,简单的一行

plot x with lines 1
已显示此错误。你必须使用

plot x with lines linetype 1
因此,必须固定设置线型(或点类型)的所有其他位置

可能意味着plot语句中缺少“,”符号。我自己在你的密码里找不到。可能您需要删除“Scr=”之前的空格
但我也遇到了类似的问题。

很高兴你的问题解决了,不过在你的问题中没有必要提及它!