gnuplot は、対話型のグラフを描くソフトウェアです。 gnuplot でできることはたくさんありますが、ここではそのうち基本的なものだけを扱います。
(例)
% gnuplot
G N U P L O T
Copyright(C) 1986 - 1993 Thomas Williams, Colin Kelley Send comments and requests
for help to info-gnuplot@dartmouth.edu
Terminal type set to 'x11'
|
(例)
gnuplot> plot x**2+x-1
gnuplot> plot tanh(x) |
abs
acos
arg
asin
atan besj0 besj1 besy0 besy1 ceil cos cosh erf erfc exp floor gamma ibeta igamma imag int inverf invnorm lgamma log log10 norm rand real sgn sin sinh sqrt tan tanh |
(例)
gnuplot>plot x**3
gnuplot> set xrange [-2:2] gnuplot> set yrange [-5:5] gnuplot> replot gnuplot> set autoscale gnuplot> replot |
(例)
gnuplot>plot sin(x), cos(x) |
(例)
gnuplot>splot sin(x)*sin(y)
gnuplot>set hidden3d gnuplot> replot |
とします。
(例)
0.000000 0.000000
0.500000 0.239713 1.000000 0.841471 1.500000 1.496242 2.000000 1.818595 2.500000 1.496180 3.000000 0.423360 3.500000 -1.227741 4.000000 -3.027210 4.500000 -4.398886 5.000000 -4.794621 5.500000 -3.880472 6.000000 -1.676493 6.500000 1.398280 7.000000 4.598906 7.500000 7.035000 8.000000 7.914866 8.500000 6.787140 9.000000 3.709066 9.500000 -0.713936 |
(例)
gnuplot> plot "test.d"
gnuplot> plot "test.d" with line gnuplot> plot "test.d" with linespoint |
x1 y1 z(x1,y1)
x2 y1 z(x2,y1)
x3 y1 z(x3,y1)
x1 y2 z(x1,y2)
x2 y2 z(x2,y2)
x3 y2 z(x3,y2)
x1 y3 z(x1,y3)
x2 y3 z(x2,y3)
x3 y3 z(x3,y3)
とします。
(例)
0.000000 0.000000 0.000000
0.000000 0.800000 0.000000 0.000000 1.600000 0.000000 0.000000 2.400000 0.000000 0.000000 3.200000 -0.000000 0.000000 4.000000 -0.000000 0.000000 4.800000 -0.000000 0.000000 5.600000 -0.000000 0.800000 0.000000 0.000000
1.600000 0.000000 0.000000
2.400000 0.000000 0.000000
3.200000 0.000000 -0.000000
4.000000 0.000000 -0.000000
4.800000 0.000000 -0.000000
5.600000 0.000000 -0.000000
|
このデータをプロットするには
splot "ファイル名"
とします。
splot "ファイル名" with line
とすると線で描きます。また
splot "ファイル名" with linespoint
とすると線と点の両方で描きます。
(例)
gnuplot> plot "test3d.d"
gnuplot> plot "test3d.d" with line gnuplot> plot "test3d.d" with linespoint |
以下の例は、eps (Encapsuled PostScript) 形式で保存しています。
(例)
gnuplot> plot "test3d.d" with line
gnuplot> set terminal postscript eps gnuplot> set output "fig.eps" gnuplot> replot |