diff options
author | hayati ayguen <h_ayguen@web.de> | 2019-12-25 01:27:33 +0100 |
---|---|---|
committer | hayati ayguen <h_ayguen@web.de> | 2019-12-25 16:53:31 +0100 |
commit | bc8d4a8c31c43dda40bc081625ef44d607e2b771 (patch) | |
tree | 61ada15bd47afb4325a8eb1b86a145b63099b0ab /plots.sh | |
parent | cd60b962bb8ca90403146b2daec885500068eeae (diff) | |
download | pffft-bc8d4a8c31c43dda40bc081625ef44d607e2b771.tar.gz |
added generation of gnuplot figures as pseudo-ctest; +bench_all.sh
* test_pffft now produces .csv files directly
* automatic compilation/testing and plots with bench_all.sh
Signed-off-by: hayati ayguen <h_ayguen@web.de>
Diffstat (limited to 'plots.sh')
-rwxr-xr-x | plots.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/plots.sh b/plots.sh new file mode 100755 index 0000000..bc38d44 --- /dev/null +++ b/plots.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +OUTPNG="1" +W="1024" +H="768" +PTS="20" +LWS="20" + +for f in $(ls -1 *-1-*.csv *-4-*.csv); do + b=$(basename "$f" ".csv") + #echo $b + LASTCOL="$(head -n 1 $f |sed 's/,/,\n/g' |grep -c ',')" + echo "${b}: last column is $LASTCOL" + if [ $(echo "$b" |grep -c -- "-1-") -gt 0 ]; then + YL="duration in ms; less is better" + elif [ $(echo "$b" |grep -c -- "-4-") -gt 0 ]; then + YL="duration relative to pffft; less is better" + else + YL="" + fi + + E="" + if [ "${OUTPNG}" = "1" ]; then + E="set terminal png size $W,$H" + E="${E} ; set output '${b}.png'" + fi + if [ -z "${E}" ]; then + E="set key outside" + else + E="${E} ; set key outside" + fi + E="${E} ; set datafile separator ','" + E="${E} ; set title '${b}'" + E="${E} ; set xlabel 'fft order: fft size N = 2\\^order'" + if [ ! -z "${YL}" ]; then + #echo " setting Y label to ${YL}" + E="${E} ; set ylabel '${YL}'" + fi + # unfortunately no effect for + #for LNO in $(seq 1 ${LASTCOL}) ; do + # E="${E} ; set style line ${LNO} ps ${PTS} lw ${LWS}" + #done + E="${E} ; plot for [col=3:${LASTCOL}] '${f}' using 2:col with lines title columnhead" + + if [ "${OUTPNG}" = "1" ]; then + gnuplot -e "${E}" + else + gnuplot -e "${E}" --persist + fi +done |