I have the following Gnuplot:
set encoding iso_8859_1
set key right bottom #font "Helvetica,17"
set ylabel "Lookup error probability" font "Helvetica,17"
set xlabel "Hight of the reader (m)" font "Helvetica,17"
set xtics font "Helvetica,15"
set ytics font "Helvetica,15"
set size 0.75, 1.05
set terminal postscript eps enhanced color #"Helvetica" 16 #size 3.5in,3in
set grid
set key spacing 1.5
set output "ProbError6x6.eps"
list(start,end,increment)=system(sprintf("seq %g %g %g", start, increment, end))
system("(awk '(NR>8 ){print; }' Hight_6x6.csv | sed -e 's/[",]/ /g' | sort -nk36) > pe_H_6x6.txt")
set print "pe_H_6x6.dat"
do for [i in list(2,3.5,0.25) ] {
stats "pe_H_6x6.txt" u ($36==i?($37/$38):1/0) name "A" nooutput
print i*1, A_mean, (A_mean - 1.833*A_ssd/sqrt(A_records)),\
(A_mean + 1.833*A_ssd/sqrt(A_records))
}
plot [][] "pe_H_6x6.dat" using 1:2:3:4 with yerrorlines ls 2 title "6x6 blocks"
The line with the system
and with the awk
code does not work in my Gnuplot script. However, it works in the unix shell. This code removes commas and ,
in Hight_6x6.csv
, skips the first 8 lines and sort the result by the values of the 36th column.
I cannot make it work in the Gnuplot script.
The CSV file is in this link.
Your issue is probably that you include a double quote inside the command:
One work-around is to use backquotes, e.g.:
Or as I would have written it: