60 lines
1.8 KiB
Bash
Executable File
60 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ $# -eq 0 ]]; 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 2:5 via a,b
|
|
set terminal png
|
|
set xlabel 'Regularity'
|
|
set ylabel 'Iterations'
|
|
set output "${png}_regularity-vs-steps.png"
|
|
plot \
|
|
"$2" every ::1 using 2:5 title "$3", \
|
|
"$4" every ::1 using 2:5 title "$5", \
|
|
"$6" every ::1 using 2:5 title "$7", \
|
|
"$8" every ::1 using 2:5 title "$9", \
|
|
f(x) title "lin. fit" lc rgb "black"
|
|
g(x)=aa*x+bb
|
|
fit g(x) "$data" every ::1 using 4:5 via aa,bb
|
|
set xlabel 'Improvement potential'
|
|
set ylabel 'Iteration'
|
|
set output "${png}_improvement-vs-steps.png"
|
|
plot \
|
|
"$2" every ::1 using 4:5 title "$3", \
|
|
"$4" every ::1 using 4:5 title "$5", \
|
|
"$6" every ::1 using 4:5 title "$7", \
|
|
"$8" every ::1 using 4:5 title "$9", \
|
|
g(x) title "lin. fit" lc rgb "black"
|
|
h(x)=aaa*x+bbb
|
|
fit h(x) "$data" every ::1 using 4:6 via aaa,bbb
|
|
set xlabel 'Improvement potential'
|
|
set ylabel 'Fitting error'
|
|
set output "${png}_improvement-vs-evo-error.png"
|
|
plot \
|
|
"$2" every ::1 using 4:6 title "$3", \
|
|
"$4" every ::1 using 4:6 title "$5", \
|
|
"$6" every ::1 using 4:6 title "$7", \
|
|
"$8" every ::1 using 4:6 title "$9", \
|
|
h(x) title "lin. fit" lc rgb "black"
|
|
i(x)=aaaa*x+bbbb
|
|
fit i(x) "$data" every ::1 using 3:6 via aaaa,bbbb
|
|
set xlabel 'Variability'
|
|
set ylabel 'Fitting error'
|
|
set output "${png}_variability-vs-evo-error.png"
|
|
plot \
|
|
"$2" every ::1 using 3:6 title "$3", \
|
|
"$4" every ::1 using 3:6 title "$5", \
|
|
"$6" every ::1 using 3:6 title "$7", \
|
|
"$8" every ::1 using 3:6 title "$9", \
|
|
i(x) title "lin. fit" lc rgb "black"
|
|
EOD
|
|
) > "${png}.gnuplot.script"
|
|
gnuplot "${png}.gnuplot.script" 2> "${png}.gnuplot.log"
|
|
mv fit.log "${png}.gnuplot.fit.log"
|
|
fi
|