4.1 の例のように長いコマンドは 入力するのも大変で、 修正するのも、 後から再現するのも面倒である。 このような場合は、コマンドをファイルに書いておいて、 そのファイルを読み込んで中に書いてあるコマンドを実行させるとよい。
| draw.g | 
| # draw.g -- gnuplot コマンド・ファイル set term postscript eps color set output "sincos.eps" plot "table.data" using 1:2 with lines,\ "table.data" using 1:3 with lines set term x11 replot | 
| gnuplot を起動してから draw.g を load して実行 | 
| oyabun% gnuplot (ターミナルから gnuplot を起動する。) gnuplot> load "draw.g" | 
あるいは、 次のように gnuplot を起動するときの引数に指定して実行することもできる。
| draw2.g を実行 | 
| oyabun% gnuplot draw2.g | 
| draw2.g | 
| # draw2.g --- gnuplot 用のコマンド・ファイル
set term postscript eps color
set output "sincos.eps"
plot "table.data" using 1:2 with lines,\
     "table.data" using 1:3 with lines
set term x11
replot # 再描画
pause -1 "hit Enter key"
 | 
あるいは、pause -1 "hit Enter key" 無しでも、
| oyabun% gnuplot draw2.g - |