gnuplotを使ってみた
gnuplotはグラフを書いてくれる.
インストールは簡単.
apt-get install gnuplot
まず,データファイル(ファイル名はなんでもよい)を以下の形式で作成する.
load gpfile
quitで終了.
なお,ここではgpfileを作ったが,コマンドgnuplotを実行した後,プロンプト (>)から実行してもよい.
#data #xの値 yの値 1 10 2 20 3 30 4 40 5 50次に、以下のようなgpfile(ファイル名はなんでも良い)を作成.
#epsファイルにカラーで吐き出すための指定. set terminal postscript eps color #出力ファイル名の指定. set output "graph.eps" #ラインスタイルの定義. #set linustyle ラインスタイル番号 lt 色 lw 太さ set linestyle 1 lt 1 lw 5 #グラフ項目の位置指定 #set key x座標 y座標 set key 3 10 #x軸とy軸のラベル指定と出力指定. set xlabel "X" set ylabel "Y" show xlabel show ylabel #描画 #plot "データのファイル名" wl ls ラインスタイル番号(上で定義した番号) #wlは「線グラフで書け」という指定. plot "data" title 'sample' w l ls 1 #画面上に表示しなおす. set terminal x11 plot "data" title 'sample' w l ls 1gnuplotとコマンドを打つ.そして以下のコマンドを入力.
load gpfile
quitで終了.
なお,ここではgpfileを作ったが,コマンドgnuplotを実行した後,プロンプト (>)から実行してもよい.

