Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gnuplot giving warning: Skipping data file with no valid points

I am using the gnuplot script

    #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

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

But when I execute qe.conf manually, I works fine

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.

line 10: warning: Skipping data file with no valid points

Request for help.

like image 473
kate Avatar asked Nov 05 '14 21:11

kate


4 Answers

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.

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.

set datafile separator " "

or

set datafile separator whitespace

and then of course for comma try "," and tab would try "\t"

I find it best to keep putting the set datafile separator " " into the top of my scripts, to remind myself.

like image 151
Cutlasj Avatar answered Nov 09 '22 17:11

Cutlasj


You could also try checking the encoding on 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).

When I changed the file's encoding to UTF-8, Gnuplot was able to read it without issues.

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.

like image 41
Aendur Avatar answered Nov 09 '22 18:11

Aendur


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).

like image 35
Alex Mooney Avatar answered Nov 09 '22 18:11

Alex Mooney


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.

like image 35
Jon Avatar answered Nov 09 '22 18:11

Jon