[2011-02-06 19:09:29]
>>>[gnuplot]
gnuplot on Mac OSX(10.6)
gnuplotでグラフを出力して,データを比較したいんだけど,設定をそのままにデータの指定だけ変えるのが面倒だった.
http://www.r.phys.nagoya-u.ac.jp/~tkonishi/cn/misc/gnuplot.html
これみると
set term x11 n
でn番目のウィンドウに出力する.っていう設定ができるらしい.
MacPortsでいれたgnuplotはデフォルトでaquatermを使うので,aquaでも動くのかなーと思ったら動いた.
set terminal aqua enhanced 0 # 設定ほげほげ # 他のウィンドウにも引き継がれる set xrange [0:128] set xlabel 'sample number' set ylabel 'acceleration [m/s^2]' # 最初のウィンドウにプロット plot "hoge.dat" index 10 using 1 with line lw 3 title "foo^{1st}" \ , "hoge.dat" index 7 using 1 with line lw 3 title "bar^{1st}" \ , "hoge.dat" index 18 using 1 with line lw 3 title "baz^{1st}" # 次のウィンドウを指定 set terminal aqua enhanced 2 plot "hoge.dat" index 12 using 1 with line lw 3 title "foo^{2nd}" \ , "hoge.dat" index 13 using 1 with line lw 3 title "bar^{2nd}" \ , "hoge.dat" index 8 using 1 with line lw 3 title "baz^{2nd}"
ちなみに,aquatermだと横方向の文字にはフォントを指定すれば日本語も入れ
られるみたいなんだけど,縦方向の文字(y軸のラベルとか)とか回転した文字に
日本語を使うと文字化けするんですが,どなたか解決方法ご存じないでしょう
か?
余談
こんな感じにコメントアウトしたりしてたら,コメント行の最後のバックスラッシュで次の行までコメントと解釈してくれたおかげで小一時間悩みました.
# plot "hoge.dat" index 12 using 1 with line lw 3 title "foo^{2nd}" \ plot "hoge.dat" index 5 using 1 with line lw 3 title "foo^{2nd}" \ , "hoge.dat" index 13 using 1 with line lw 3 title "bar^{2nd}" \ , "hoge.dat" index 8 using 1 with line lw 3 title "baz^{2nd}"