如何在gnuplot中管理`;`预期错误 [英] How to manage `;` expected error in gnuplot

查看:108
本文介绍了如何在gnuplot中管理`;`预期错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在gnuplot 4.4中绘制图形时出现以下错误

I am getting the following error while plotting graph in gnuplot 4.4

gnuplot> set style fill transparent pattern 2 noborder 
                        ^
     "./clusterload_all.pg", line 16: ';' expected

还有一些这样的错误:

gdImageStringFT: Could not find/open font while printing string  45 with font Arial

gnuplot> plot "cpu.dat" using 1:2 with lines title "CPU% total" lw 5 lc 1,
                 '' using 1:3 with lines title "MEM% total" lw 5 lc 2,                      
'' using 1:4 with lines title "CPU% for clmServer" lw 5 lc 6,                     
'' using 1:5 with lines title "MEM% for clmServer" lw 5 lc 10,                     
'' using 1:8 with boxes fill transparent pattern 2 title "1: Uninstall Licenses" lw 2 lc 5,  
'' using 1:9 with boxes fill transparent pattern 2 title "2: Install Licenses" lw 2 lc 6,
'' using 1:10 with boxes fill transparent pattern 2 title "3: Query Installed Licenses" lw 2 lc 7,                     
'' using 1:11 with boxes fill transparent pattern 2 title "4: Creating Feature Codes" lw 2 lc 11,                     
'' using 1:12 with boxes fill transparent pattern 2 title "5: Register Feature Codes" lw 2 lc 3,                     
'' using 1:13 with boxes fill transparent pattern 2 title "6: Query Feature Codes" lw 2 lc 1,                     
'' using 1:14 with boxes fill transparent pattern 2 title "7: Unregister Feature Codes" lw 2 lc 21
                                                                 ^
     "./clusterload_all.pg", line 29: ';' expected

有人可以帮助我吗?

推荐答案

要管理该错误,您需要了解在生成该错误的行中会发生什么.

To manage the error you need to understand what happens in the line that generated it.

Gnuplot解释器提供帮助,使用光标"^"签名有问题的单词的第一个字母,并在可能找到它的地方写行号(如果是脚本,则为行号)会被load "myscript.gp"加载,或者gnuplot被命令行作为gnuplot myscript.gp调用.)

Gnuplot interpreter gives an help signing with the cursor "^" the first letter of the offending word and writing the line number where it is possible to find it (the line number if a script is loaded with load "myscript.gp" or gnuplot is invoked by command line asgnuplot myscript.gp).

起源可能是多种多样的,因为直到该令人反感的词为止,语法似乎是可以接受的.
让我仅举几个例子:

The origin can be various since, until that offending word, the syntax seems to be acceptable.
Let me cite just a few examples:

  • 选项顺序不正确

  • A not correct order in the option sequence

plot "<seq 1 20" with lines using 0:($1) # before "using" after "with"

  • gnuplot版本当前接受的行,但与其他版本没有区别(不仅版本或版本号不同,甚至

  • A line currently accepted by a version of gnuplot but not from a different one (that differs not only for version or subversion number, but even only for compilation option)
  • 注意:通过使用反斜杠(\),可以拆分不同的行,很长很长的命令,就像写在一行中一样.它很舒适而且干净,尤其是在脚本中.
    产生错误时,会重新组合此长行的输出,因此,与有问题的单词^)的列可能会出现错误>在脚本中.

    Note: with the use of the backslash(\) it's possible to split on different lines a long long command as if it was written in a single line. It's cosy and clean especially in a script.
    When the error is generated the output of this long long line is recomposed so the column of the cursor(^) can appear wrong if compared with the position of the offending word in the script.

    要重现您的特定错误,我们只能使用某些不同版本的gnuplot检查命令的内核.

    To reproduce your specific error we can check only the kernel of your command with some different version of gnuplot.

    set style fill transparent pattern 2 noborder

    结果报告如下:

    • gnuplot 4.1.0 中,它会给我相同的错误消息

       gnuplot> set style fill transparent pattern 2 noborder 
                               ^
                 ';' expected
    

    gnuplot 4.6.3中的

  • 我完全没有错误.

  • in gnuplot 4.6.3 I have no error at all.

    请再次验证您系统上的版本...
    ...并且随时可以自由更新它:-)它已经很旧了.

    Please verify once again the version you have on your system...
    ...and feel you free to update it as you can :-) it's rather old.

    更严重的是,如果您无法上传使用的版本,则可以从旧演示中获取有关过去语法的提示(即 http://gnuplot.sourceforge.net/demo_4.4/)...还是旧版本中的.通常会有向后兼容,同时还有

    More seriously if you cannot upload the version you use, you can take hints about the past syntax from the old demo (i.e. http://gnuplot.sourceforge.net/demo_4.4/ )... or from the older ones. Usually there is backward compatibility, meanwhile the forward compatibility is more difficult to find.

    ps>您可以从内部解释器编写较长的命令行,也可以以更舒适的方式将其写入外部文件( script ).您可以在gnuplot中或在gnuplot解释器中使用命令load "./clusterload_all.pg"加载脚本,也可以在shell提示符下使用命令行gnuplot -persist ./clusterload_all.pg调用.

    ps> You can write that long command line from the internal interpreter or in a more cosy way you can write it in an external file (a script). You can load the script in gnuplot or with the command load "./clusterload_all.pg" inside the gnuplot interpreter or you can call with the command line gnuplot -persist ./clusterload_all.pg from the shell prompt.

    这篇关于如何在gnuplot中管理`;`预期错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆