2017-09-27 20:06:25 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
|
|
echo "usage: $0 <DATA.csv>"
|
|
|
|
else
|
|
|
|
data="$1";
|
|
|
|
png="`echo $1 | sed -s "s/\.csv$//"`" # strip ending
|
|
|
|
(cat <<EOD
|
|
|
|
set datafile separator ","
|
|
|
|
f(x)=a*x+b
|
|
|
|
fit f(x) "$data" every ::1 using 1:5 via a,b
|
|
|
|
set terminal png
|
2017-10-27 12:31:55 +00:00
|
|
|
set xlabel 'Regularity'
|
|
|
|
set ylabel 'Number of iterations'
|
2017-09-27 20:06:25 +00:00
|
|
|
set output "${png}_regularity-vs-steps.png"
|
2017-10-01 18:14:34 +00:00
|
|
|
plot "$data" every ::1 using 1:5 title "data", f(x) title "lin. fit" lc rgb "black"
|
2017-09-27 20:06:25 +00:00
|
|
|
g(x)=aa*x+bb
|
|
|
|
fit g(x) "$data" every ::1 using 3:5 via aa,bb
|
2017-10-27 12:31:55 +00:00
|
|
|
set xlabel 'Improvement potential'
|
|
|
|
set ylabel 'Number of iterations'
|
2017-09-27 20:06:25 +00:00
|
|
|
set output "${png}_improvement-vs-steps.png"
|
2017-10-01 18:14:34 +00:00
|
|
|
plot "$data" every ::1 using 3:5 title "data", g(x) title "lin. fit" lc rgb "black"
|
2017-09-27 20:06:25 +00:00
|
|
|
h(x)=aaa*x+bbb
|
|
|
|
fit h(x) "$data" every ::1 using 3:4 via aaa,bbb
|
2017-10-27 12:31:55 +00:00
|
|
|
set xlabel 'Improvement potential'
|
|
|
|
set ylabel 'error given by fitness-function'
|
2017-09-27 20:06:25 +00:00
|
|
|
set output "${png}_improvement-vs-evo-error.png"
|
2017-10-01 18:14:34 +00:00
|
|
|
plot "$data" every ::1 using 3:4 title "data", h(x) title "lin. fit" lc rgb "black"
|
2017-10-25 18:40:51 +00:00
|
|
|
i(x)=aaaa*x+bbbb
|
|
|
|
fit i(x) "$data" every ::1 using 2:4 via aaaa,bbbb
|
2017-10-27 12:31:55 +00:00
|
|
|
set xlabel 'Variability'
|
|
|
|
set ylabel 'error given by fitness-function'
|
2017-10-25 18:40:51 +00:00
|
|
|
set output "${png}_variability-vs-evo-error.png"
|
|
|
|
plot \
|
|
|
|
"$data" every ::1 using 2:4 title "data", \
|
|
|
|
i(x) title "lin. fit" lc rgb "black"
|
2017-09-27 20:06:25 +00:00
|
|
|
EOD
|
|
|
|
) > "${png}.gnuplot.script"
|
|
|
|
gnuplot "${png}.gnuplot.script" 2> "${png}.gnuplot.log"
|
|
|
|
mv fit.log "${png}.gnuplot.fit.log"
|
|
|
|
fi
|