gnuplotメモ


細かい点のメモ(以下の情報はgnuplot 4.4くらいの世代の情報に基づいている)最新版gnuplot (gnuplot 5.0以降)での新機能:参考リンクも参照。

linescolor (number)1.赤 2.緑 3.青 4.ピンク 5.水色 6.黄色 7.黒 8.オレンジ 9.灰色
error bar ・コマンド例 plot 'datafile.txt' using 1:2:3 with xerrorbars plot 'datafile.txt' using 1:2:4 with yerrorbars plot 'datafile.txt' using 1:2:3:4 with xyerrorbars ・上下対称 "using (xの値):(yの値):(yの範囲:±値の絶対値) with yerrorbars" や、 "using (xの値):(yの値):(xの範囲:±値の絶対値):(yの範囲:±値の絶対値) with xyerrorbars" とする。 ・上下非対称 "using (xの値):(yの値):(yの最小値):(yの最大値) with yerrorbars" や、 "using (xの値):(yの値):(xの最小値):(xの最大値):(yの最小値):(yの最大値) with xyerrorbars" とする。
error barの先端部の長さ・「set bar 数字」 ・太さは、plot時のlinewidthで調整
plot領域を正方形に 「set size square」or [set size ratio 1]
余分な余白の切り取り ・eps file 内の"Bounding Box"を適当な値へ編集。 ・「eps2eps input.eps output.eps」とすると、おおよそ適当な変換してくれはするが、切り取りすぎ?
破線の間隔 ・冒頭で、「set term postscript eps enhanced color dashlength 5 size 6,4」などとする。dashlengthを変えると、破線の間隔が変わる。参考リンク ・もっと細かい調整をしたい場合は、gnuplotで出力した後のepsファイルをtxtファイルとして編集する。「/LT1」や「/LT2」か始まる行の数字の部分を変えると、幅が変わる。
軸の数字(目盛)の任意設定 ・「set xtics ("626.45" 6264.5 0, 6264.75 1, "626.50" 6265 0, 6265.25 1, "626.55" 6265.5 0)」などとする。 「,」の前の「0」及び「1」は、「0」は大目盛の設定で、「" "」内の文字数字を表示する、「1」は、小目盛の設定に対応。

太陽の記号(Latexの\odot)を文字として書く。 (1)まず、cmsy10.pfa.txtを同じディレクトリに置く。 (2)冒頭の所で、「set terminal postscript enhanced fontfile 'cmsy10.pfa.txt' (3)例えば、set xlabel "M [M_{/CMSY10 \014}]"

Keyの設定 set key {on|off} {default} {{inside | outside} | {lmargin | rmargin | tmargin | bmargin} | {at <position>}} {left | right | center} {top | bottom | center} {vertical | horizontal} {Left | Right} {{no}reverse} {{no}invert} {samplen <sample_length>} {spacing <vertical_spacing>} {width <width_increment>} {height <height_increment>} {{no}autotitle {columnheader}} {title "<text>"} {{no}enhanced} {{no}box { {linestyle | ls <line_style>} | {linetype | lt <line_type>} {linewidth | lw <line_width>}}} unset key show key