2014年3月4日火曜日

gnuplotで出力&y軸の2軸を作る

ゴミなのですぐ忘れるのでgnuplotメモ。まあググればすぐ出るんだけど自分用にまとめておく。

gnuplotでpngで出力
>set terminal png
>set output 'outputname.png'
>plot hogehoge #プロットしているやつのplotコマンドをもう一度打つ
>set output

epsの場合は
>set terminal postscript enhanced eps
してあとは同じ。postscript epsだけだとモノクロになる。

あと右側にy軸の第2軸を作るとき。あと他にもメモ。
http://www.int.otaru-uc.ac.jp/lyx-howto/writing/gnuplot/two-graphs
参照。
>set ytics nomirror
>set y2tics
>set xlabel "hoge"
>set ylabel "hoge2"
>set y2label "hoge3"
>set y2range[1:10]
>set y2label font "arial,20"
>unset key
>plot "hoge.dat" using 1:3 with line axes x1y1

とりあえず。