【问题标题】:Gnuplot : My scripts seems to be good but I've the error " Invalid character \ "Gnuplot:我的脚本似乎不错,但出现错误“无效字符 \”
【发布时间】:2020-04-19 01:04:18
【问题描述】:

我想用 AIX 7.2 和 Gnuplot 4.6 创建一个 Gnuplot 脚本

我的脚本是:


set terminal png truecolor size 1950, 650  background rgb "#eff1f0"
set output "/home/tbenedet/GNUPLOT/used.png"
set datafile separator ';'

set size ratio 0.2
set bmargin at screen 0.2
unset key
set datafile separator ";"
set ylabel " MB BLOCK " font ",10" offset -1,0
set xlabel font ",10"
set xtics rotate by 45  offset -0.8,-9,-1.8


plot "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \
     "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5

乍一看,我的脚本是正确的...但是当我尝试使用gnuplot myscript.txt 运行它时,我遇到了这个错误:

plot "/var/xxx/xxx/xxx/xxx/xxx/xxx/xxx/foo.txt" using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \ using 3:xtic(1) title column(2) with linespoints linewidth 2 pointtype 7 pointsize 1.5, \ 
                                                                                                                                                                           ^
"myscript.txt", line 14: invalid character \

我不知道是我的错误...你能告诉我吗?

谢谢

【问题讨论】:

  • 可能你达到了行的最大长度。只尝试一行,然后再添加一行,等等......
  • 或者\反斜杠后面可能有别的东西;例如一个 CR 字符 (0x0d)

标签: plot gnuplot aix


【解决方案1】:

您的绘图命令的长度约为 3600 个字符。我不确定是否有长度限制,或者至少它必须超过 10'000,因为我尝试了超过 10'000 个字符的类似命令,但我没有收到您的错误。 顺便说一句,如果你不知道,你可以缩短不少关键字:using to u, title to ti, with to w, linespoints to @987654328 @、linewidthlwpointtypeptpointsizeps

我猜(正如 Lorinczy Zsigmond 已经提到的)你在 \ 之后有一些“隐形”字符,它也可能是 empty spaceTAB。 一些合理的文本编辑器可以使“不可见”的字符“可见”。检查同一行中\之后是否有字符。

来自 gnuplot 手册。检查help introduction

命令可以通过以反斜杠 () 结束每一行但最后一行结束的方式延伸到多个输入行。反斜杠必须是每一行的 last 字符。效果就好像反斜杠和换行符不存在一样。也就是说,没有隐含空格,也没有终止注释。因此,注释掉一个连续的行 cmets 会删除整个命令(请参阅 cmets)。但请注意,如果在多行命令的某处发生错误,解析器可能无法准确定位错误所在的位置,并且在这种情况下不一定会指向正确的行。

【讨论】:

    猜你喜欢
    • 2017-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多