描画する線の範囲を指定する
plot [x_min : x_max] [y_min : y_max] <expression> # 二次元の場合
splot [x_min : x_max] [y_min : y_max] [z_min : z_max] <expression> # 三次元の場合
set xrange [min:max]
set yrange [min:max]
set zrange [min:max]
plot [-2*pi:2*pi] sin(x)

開始座標だけを指定したり、終了座標だけを指定したりすることもできます。
plot [0:] sin(x) # set xrange [0:] ; plot sin(x) と同じ
plot [:pi] cos(x) # set xrange [:pi] ; plot cos(x) と同じ
plot [] [-pi:pi] sin(x**2) # set yrange [-pi:pi] ; plot sin(x**2) と同じ
プロットのオフセットを設定
set offset <left>, <right>, <top>, <bottom> # マージン設定
show offset # マージン表示
set offset 2, 2, 1, 1
set grid
plot [-2*pi:2*pi] cos(x)

グラフのマージンを設定する
set lmargin left # 左の余白を指定(文字数で指定)
set rmargin right # 右の余白を指定(文字数で指定)
set tmargin top # 上の余白を指定(文字数で指定)
set bmargin bottom # 下の余白を指定(文字数で指定)
グラフの外形だけを表示したい場合などは、タイトルやラベルなどを表示するためのマージンは必要ないので、次のようにすると余計な空白をなくすことができます。
set lmargin 0
set rmargin 0
set tmargin 0
set bmargin 0
set nokey
plot [0:2*pi] sin(x)**2

あれれ、右と上の枠がなくなってしまいました(>_< こんな場合はしょうがないので、rmargin
と tmargin
を 1 にして次のようにします。
set lmargin 0
set rmargin 1
set tmargin 1
set bmargin 0
set nokey
plot [0:2*pi] sin(x)**2

目盛りの表示内容が 2 行以上に渡る場合などは、bmargin
を少し広げてやらないと、表示が切れてしまうことがあります。
set xtics ( \
"5sec\n10sec\n15sec" 5, \
"10sec\n15sec\n20sec" 10, \
"15sec\n20sec\n25sec" 15)
set bmargin 4
plot "-" with linespoints
5 10
10 12
15 17M
E
