***** gnuplot の使い方 ***** Sep. 11, 1997 last updated at Feb. 03, 2000 written by : M. HAYASAKI 1. 初歩の初歩 i) command line で gnuplot と打ち込む ii) "gnuplot>" プロンプトで以下のように打ち込む: ex. gnuplot> plot 'ifile' using 1:3 with lines こうすれば、ifile というファイルの1列目をx軸、3列目をy軸として 折れ線グラフを書く。 さらに上書きしたい時には、 ex. gnuplot> replot 'ifile' using 1:4 with linespoints などとする。 lines の他には dots linespoints impulses steps などがある。 詳しくは gnuplot プロンプトで help と打ち込めばマニュアルが読める(ただし英語)。 iii) log-scale で書きたい時 パワースペクトルを書く時のように、y軸をlog-scale にする場合: gnuplot> set logscale y 10 gnuplot> plot "power.1987NDJFM" using 2:4 with lines ---------------------------------------------------------------------- 2."3-dimentional" な図を書きたいとき: gnuplot> splot [0:360] [1:74] [0:70] "cnt_block-date_pent.dat" using 1:2:3 with impulses 最初の鈎括弧3つはx,y,z軸の範囲。見栄えは良くないが、quick-look 程度には使える ---------------------------------------------------------------------- 3. script にしたい時 いつもいつもコマンドラインから打ち込むのは面倒。 だから、あらかじめコマンドを記述してあるファイルを作成しておき、 それを実行するようにすればとても楽。 gnuplot> load "test.plt" test.plt の中身: plot [1:302] "bgt80NDJFM.60_110E.55_70N" using 1:7 with lines replot "bgt81NDJFM.60_110E.55_70N" using 1:7 with lines replot "bgt82NDJFM.60_110E.55_70N" using 1:7 with lines replot "bgt83NDJFM.60_110E.55_70N" using 1:7 with lines replot "bgt84NDJFM.60_110E.55_70N" using 1:7 with lines replot "bgt85NDJFM.60_110E.55_70N" using 1:7 with lines コマンドラインで打ち込んでいる記述をそのまま書くだけ。 quick view には便利。