gnuplotをループさせる

移転しました。

自分へのメモ

データせっせと吐き出したはいいけれど、それをグラフで可視化したい場合の処理をさせたかった。以下のページを参考に書いてみた。

#!/bin/sh

# `seq 0 N`で0-29までの整数を読み込み

for i in `seq 0 29`
do
#---シェル内でのgnuplot起動
#### EOF行までの間に空行を挟んではいけない。
gnuplot <<EOF
set out "result$i.png
set terminal png
plot 'result$i.dat' u 1:3 w l ti 'bestValue', 'result$i.dat' u 1:4 w l ti 'fitnessSol','result$i.dat' u 1:6 w l ti 'minBar','result$i.dat' u 1:8 w l ti 'fitnessCri'
EOF
done

参考

シェルスプリクトによるデータ処理
http://www.e.ics.nara-wu.ac.jp/~nogu/tips/shellscript.html