GNUPLOT


Plot command

  • データファイルのデータをプロットするときの基本
    >  plot [xmin:xmax][ymin:ymax] 'filename' using 3:4
    
    using 以下は,データファイルの何カラム目を使うかを指定.この例だと3列目を x軸,4列目をy軸にプロット.1次元プロットならば,当然,数字を1個だけ与えて やればよい.
  • グラフの種類
    • 'plot ??? with points'   ... 点
    • 'plot ??? with lines'   ... 折れ線
    • 'plot ??? with linespoints'   ... 折れ線と点
    • 'plot ??? with dots'   ... 1dotの点
    • 'plot ??? with impulses'   ... 太さ1dotの棒グラフ
    • 'plot ??? with boxes'   ... 柱状
    • 'plot ??? with steps'
    • 'plot ??? with errorbars'
    • 'plot ??? with boxerrorbars'
  • 点の大きさ,線の太さなど
    • 'plot ??? with linespoints (or lp) lt 3 lw 1.5 pt 5 ps 1.8
      (linespoints で,線の種類を3番目のものに,線の太さを 1.5 に,点の種類を 5番目のものに,点の大きさを 1.8 にする.もちろんすべて指定する必要はない.)
  • 凡例
    • 'plot ??? title "..." ' (凡例のindexを指定できる)
  • splot   (surface plot)
    • 'splot ??? using ?:?:? with lines'   ...etc.
    • データ1列分ごとに,空行を入れないとうまく線を入れてくれないらしい.
        00 00 00
        00 00 00
        00 00 00
                 ←こんな感じ
        00 00 00
        00 00 00
        00 00 00
      
        00 00 00
        00 00 00
        00 00 00
      
        00 00 00
        00 00 00
        00 00 00
      


set ...

以下は,要は環境設定なので,"replot"を打つなりしてプロットし直さないと 有効にならない.

  • x軸,y軸,etc...
    • set xtics 0,1,10 <- (始め,増分,終り)
    • set xtics ("..." ??,"..." ??) (逐一書いていく)
    • set xlabel "..." {<xoff>}{,<yoff>}
    • set xrange [ ... : ... ] (範囲を指定)
    • set autoscale x
  • grid
    • set grid
  • 凡例
    • set key x, y (曲線のラベルの位置を指定)
  • Surface plotの視点
    • set view 60,30   ...( 真上から60度,-yの方向から30度の角度から見る)



戻る