Html gnuplot 发出警告:跳过没有有效点的数据文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26767359/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
gnuplot giving warning: Skipping data file with no valid points
提问by kate
I am using the gnuplot script
我正在使用 gnuplot 脚本
#qe.conf
set terminal png truecolor
set output "qe.png"
set xrange ["400" : "700"]
set yrange ["0" : "1"]
set style data lines
plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R"
I am executing the gnuplot script qe.conf through a shell script It gives me the following error
我正在通过 shell 脚本执行 gnuplot 脚本 qe.conf 它给了我以下错误
gnuplot> plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R" ^ line 0: warning: Skipping data file with no valid points
gnuplot> plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R" ^ line 0: warning: Skipping data file with no valid points
gnuplot> plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R" ^ line 0: warning: Skipping data file with no valid points
gnuplot> plot "qe.txt" using 1:2 title "%Red", '' using 1:3 title "%G-r", '' using 1:4 title "%G-b", '' using 1:5 title "%R" ^ line 0: warning: Skipping data file with no valid points
gnuplot> 使用 1:2 标题“%Red”绘制“qe.txt”,'' 使用 1:3 标题“%Gr”,'' 使用 1:4 标题“%Gb”,'' 使用 1:5 标题“ %R" ^ 第 0 行:警告:跳过没有有效点的数据文件
gnuplot> 使用 1:2 标题“%Red”绘制“qe.txt”,'' 使用 1:3 标题“%Gr”,'' 使用 1:4 标题“%Gb”,'' 使用 1:5 标题“ %R" ^ 第 0 行:警告:跳过没有有效点的数据文件
gnuplot> 使用 1:2 标题“%Red”绘制“qe.txt”,'' 使用 1:3 标题“%Gr”,'' 使用 1:4 标题“%Gb”,'' 使用 1:5 标题“ %R" ^ 第 0 行:警告:跳过没有有效点的数据文件
gnuplot> 使用 1:2 标题“%Red”绘制“qe.txt”,'' 使用 1:3 标题“%Gr”,'' 使用 1:4 标题“%Gb”,'' 使用 1:5 标题“ %R" ^ 第 0 行:警告:跳过没有有效点的数据文件
But when I execute qe.conf manually, I works fine
但是当我手动执行 qe.conf 时,我工作正常
The datafile is here.
数据文件在这里。
400.0 0.3625060772
410.0 0.445987595886
420.0 0.503862994331
430.0 0.534251869841
440.0 0.576047041939
450.0 0.594211326218
460.0 0.58079588866
470.0 0.506666961836
480.0 0.495652452097
490.0 0.426107864611
500.0 0.342632041157
510.0 0.251232093174
520.0 0.178015786221
530.0 0.140803848655
540.0 0.120063881639
550.0 0.0995420648319
560.0 0.080193952073
570.0 0.0730989150532
580.0 0.0708069989426
590.0 0.0688014659014
600.0 0.0597099385221
610.0 0.0481330987744
620.0 0.042010859344
630.0 0.0425115579982
640.0 0.0460125024438
650.0 0.0515227545961
660.0 0.0559745367996
670.0 0.0629981328342
680.0 0.0573046109671
690.0 0.0688715871636
700.0 0.0742304568215
`
`
Can anyone suggest a solution?
任何人都可以提出解决方案吗?
Hi All, After hours of trying I still dont have the answer. I tried the following things. I tried giving absolute paths for datafile, gnuscript and shell script. The command gnuplot qe.conf works fine if run from linux command prompt but when run through the shell script gives this error.
大家好, 经过数小时的尝试,我仍然没有答案。我尝试了以下事情。我尝试为数据文件、gnuscript 和 shell 脚本提供绝对路径。如果从 linux 命令提示符运行,命令 gnuplot qe.conf 可以正常工作,但是当通过 shell 脚本运行时会出现此错误。
line 10: warning: Skipping data file with no valid points
第 10 行:警告:跳过没有有效点的数据文件
Request for help.
请求帮助。
回答by Cutlasj
I get this error everytime I try to plot a .csv
(comma separated variables) file, I forget that sometimes gnuplot needs to be reminded what the delimiter is. Usually I get the same error you mention, sometimes I get no error, but in either case, no data is plotted until delimiter is defined properly.
每次我尝试绘制.csv
(以逗号分隔的变量)文件时都会收到此错误,我忘记了有时需要提醒 gnuplot 需要提醒分隔符是什么。通常我会遇到您提到的相同错误,有时我没有错误,但在任何一种情况下,在正确定义分隔符之前都不会绘制数据。
gnuplot defaults to whitespace as a delimiter, but perhaps you overrode that and set it to comma or something. Try telling gnuplot what your delimiter is.
gnuplot 默认使用空格作为分隔符,但也许您覆盖了它并将其设置为逗号或其他东西。尝试告诉 gnuplot 您的分隔符是什么。
set datafile separator " "
set datafile separator " "
or
或者
set datafile separator whitespace
set datafile separator whitespace
and then of course for comma try ","
and tab would try "\t"
然后当然对于逗号尝试","
和制表符会尝试"\t"
I find it best to keep putting the set datafile separator " "
into the top of my scripts, to remind myself.
我发现最好将 放在set datafile separator " "
我的脚本顶部,以提醒自己。
回答by Aendur
You could also try checking the encodingon you data file.
您也可以尝试检查数据文件的编码。
I've just come across this exact problem as well when trying to plot a data file. And it turned out that Gnuplot was unable to understand the data file due to its encoding (which was UTF-16LE).
在尝试绘制数据文件时,我也刚刚遇到了这个确切的问题。事实证明,由于编码(UTF-16LE),Gnuplot 无法理解数据文件。
When I changed the file's encoding to UTF-8, Gnuplot was able to read it without issues.
当我将文件的编码更改为UTF-8 时,Gnuplot 能够毫无问题地读取它。
Since this post is already a bit old, you've probably already managed to solve it. Though I just thought it might help anyone else who also gets this problem.
由于这篇文章已经有点旧了,你可能已经设法解决了它。尽管我只是认为它可能会帮助其他也遇到此问题的人。
回答by Alex Mooney
The problem here is that you're trying to plot the 3rd, 4th, and 5th columns of a two column dataset. If you change your plot command to drop everything that's using 1:3 or higher, it should work just fine. The error message is telling you that the data file really is empty (in the higher columns).
这里的问题是您试图绘制两列数据集的第 3、4 和 5 列。如果您更改绘图命令以删除使用 1:3 或更高比例的所有内容,它应该可以正常工作。错误消息告诉您数据文件确实是空的(在较高的列中)。
回答by Jon
Recently, I had the same issue using Gnuplot 5.0.4. As Aendur suggested, the encoding could be problematic. What fixed it for me was, using TextWrangler, to change the line breaks, in my case from "Mac Classic (CR)", to "Unix (LF)" without having to change the encoding of the file to UTF-8.
最近,我在使用 Gnuplot 5.0.4 时遇到了同样的问题。正如 Aendur 所建议的那样,编码可能有问题。对我来说修复它的是,使用 TextWrangler,将换行符从“Mac Classic (CR)”更改为“ Unix (LF)”,而无需将文件编码更改为 UTF-8。