GNUPLOT 28 3 15 UNIX Microsoft-Windows GNUPLOT 4 GNUPLOT 1 GNUPLOT 2 2 3 2.1 UNIX.......................................... 3 2.2 Windows........................................ 4 2.3.................................. 4 3 GNUPLOT 4 3.1.................................. 4 3.2...................................... 5 3.3......................................... 5 3.4........................................... 6 3.5......................................... 6 3.6....................................... 7 3.7.................................. 7 3.8.................................... 7............................................. 8 4 8 5 8 5.1......................................... 8 5.2..................................... 1............................................. 1 1
6 11 6.1........................................... 11 6.2.................................... 11 6.3...................................... 12 7 13 7.1.................................... 13 7.2....................................... 14 7.3.............................. 15 7.4....................................... 16 8 17 8.1.............................. 17 8.2...................................... 18 8.3.......................................... 19 9 2 1 GNUPLOT............................... 3 2 MS-Windows GNUPLOT.................... 4 3 y = x 2 2x.................................. 9 4...................................... 14 5 ( )............................... 15 6................................ 16 7....................................... 16 8................................. 18 9..................................... 19 1.............................. 2 11................................. 21 1 GNUPLOT GNUPLOT GNUPLOT 1 2
( ) GNUPLOT GNUPLOT TEX fitting GNUPLOT 2 2.1 UNIX UNIX X kterm GNUPLOT % gnuplot % UNIX ( ) GNUPLOT 1 1: GNUPLOT 3
2.2 Windows Windows GUI GNUPLOT GNUPLOT Wgnuplot GNUPLOT for Windows 2 GNUPLOT GNUPLOT GNUPLOT UNIX 2: MS-Windows GNUPLOT 2.3 GNUPLOT UNIX Windows GNUPLOT gnuplot> GNUPLOT pwd GNUPLOT GNUPLOT GNUPLOT quit exit UNIX Windows GNUPLOT 3 GNUPLOT 3.1 GNUPLOT UNIX % mkdir ~/gplot % cd ~/gplot % gnuplot (~ ) gplot GNUPLOT GNUPLOT pwd GNUPLOT GNUPLOT 4
cd % cd % gnuplot gnuplot cd Windows GNUPLOT ChDir 3.2 GNUPLOT Windows 1 + 2 gnuplot> print 1+2 Enter ( gnuplot> GNUPLOT ) Windows Expressions Evaluate print 1+2 Enter Expressions Functions GNUPLOT print 9/4 2 9./4 9/4. 2.25 3.3 GNUPLOT gnuplot> print sin(3.14) gnuplot> print log(exp(1.)**2) 5
sqrt ( ) cos tan abs ( ) atan (Arctan) floor ( ) tanh besj (Bessel ) gamma (Γ ) 3.4 gnuplot> kekka = sin(3.14) + 1 gnuplot> print kekka 1.159 gnuplot> print - kekka -1.159 kekka ( ) the_mass_of_electron 1 kekka Kekka kekka 1.159 kekka=.5 3.5 2 2 ( ) gnuplot> f(x) = x**2. - 2.*x gnuplot> g(x,y) = x**2 - y**2 gnuplot> print f(3.) 3. gnuplot> print g(2., 1.) 3. gnuplot> print g(1., 2.) -3. * ** f(x) = x 2 2x 1 2 g(x, y) = x 2 y 2 2 print x y 1. 2. 3. = 6
3.6 GNUPLOT gnuplot> sin = 12345 gnuplot> print sin(3.14).159265 gnuplot> print sin 12345 gnuplot> print = 123 gnuplot> print 456 456 gnuplot> print print 123 3.7 Backspace Enter Windows Prev Next 3.8 help UNIX Return Return Windows Help help GNUPLOT functions gnuplot> help functions 7
e x exp(x) pr exp(1) e 2.71828... e 2+3 e 2 e 3 e 2 + e 3 GNUPLOT e 2 3 e 2 e 3 4 GNUPLOT Windows File Demos demo OK.dem GNUPLOT UNIX GNUPLOT ( ) % mkdir gplotdemo % cp /usr/share/doc/gnuplot-doc/examples/* gplotdemo/ % cd gplotdemo % gnuplot all.dem all.dem % gnuplot simple.dem Hit return to continue Enter Notepad emacs GNUPLOT # 5 5.1 y = x 2 2x gnuplot> plot x**2-2*x 8
( x plot dummy ) x = x = 2 x 2 gnuplot> set xrange [-1:3] gnuplot> replot set set xrange replot 3 set xrange gnuplot> set xrange [-1, 3] ^ : or keyword to expected : ( ) to 3.5 A Parabola 3 2.5 Dependent variable 2 1.5 1.5 -.5-1 -1 -.5.5 1 1.5 2 2.5 3 Independent variable 3: y = x 2 2x y y = 1/x set yrange y x gnuplot> set yrange [-3:3] gnuplot> plot 1/x y gnuplot> set autoscale y show 9
gnuplot> show xrange gnuplot> show all replot rep plot p OK set xrange se xr Ok se x 5.2 gnuplot> set xlabel "Independent variable" gnuplot> set ylabel "Dependent variable" gnuplot> set title "A Parabola (by Imoko Ono, May 67)" gnuplot> replot "Independent variable" Windows Axes Chart gnuplot> set grid gnuplot> replot set grid unset grid Key Regend( ) gnuplot> unset key Windows Chart g(x) = e x2 g(x)=exp(-x**2) plot g(x) 2g(x) plot 2*g(x) g(x) 1 g(2x) g(x/2) g(x 2) g(x + 1) 1
6 6.1 Windows Print UNIX GNUPLOT gnuplot> se te po la 22; se ou " lpr"; rep; se ou; se te x11 " lpr" se ou " lpr" set output " lpr" GNUPLOT lpr lpr gtklp gnuplot> se te po la 22; se ou " gtklp"; rep; se ou; se te x11 gtklp gnuplot> set terminal postscript landscape 22 gnuplot> set output " lpr" gnuplot> replot gnuplot> set output gnuplot> set term x11 UNIX PostScript landscape portrait 22 22 (1.35 mm) help postscript replot set output lpr X PostScript 6.2 landscape eps Windows eps 11
Encapsulated PostScript gnuplot> se te po eps 22; se ou "parabola.eps"; rep; se ou; se te x11 Windows gnuplot> se te po eps 22; se ou "parabola.eps"; rep; se ou; se te win UNIX % gv parabola.eps gv ggv evince display ( ) Windows L A TEX eps Adebe Illustrator eps epsbox graphics L A TEX web eps png gnuplot> se te png giant; se ou "parabola.png"; rep; se ou; se te x11 giant png GNUPLOT web 6.3 Adobe Illustrator eps Adobe Illustrator inkscape Adobe Illustrator inkscape inkscape eps svg svg gnuplot> se te svg size 1 75 fsize 2 gnuplot> se ou "parabola.svg"; rep; se ou; se te x11 size fsize inkscape UNIX Windows GNUPlot set terminal tgif tgif fig xfig 12
UNIX L A TEX L A TEX L A TEX psfrag Postscript TEX TEX EQ1 x N(x )dx Postscript EQ1 eps svg Adobe Illustrator inkscape eps GNUPLOT TEX set terminal epslatex epslatex eps TEX tex TEX 7 7.1 x y = 1 (x 1/x) 2 + D 2 D D D x-y R(x, D) gnuplot> R(x, D)= 1 / ( (x - 1/x)**2 + D**2 ) D = 1 gnuplot> plot R(x, 1) D =.5 D = 2 gnuplot> se title "Response of Linear Oscilator" gnuplot> set xlabel "normalized frequency" gnuplot> set ylabel "intensity" gnuplot> set xrange [: 4] gnuplot> set samples 25 gnuplot> set key gnuplot> plot R(x, 1) title "D=1", R(x, 2) ti "D=2", R(x,.5) ti "D=.5" 13
4 3.5 3 Response of Linear Oscilator D=2 D=1 D=.5 intensity 2.5 2 1.5 1.5.5 1 1.5 2 2.5 3 3.5 4 normalized frequency 4: plot set samples 1 25 set key plot title "D=1" 7.2 D x gnuplot> set logscale x gnuplot> set logscale y gnuplot> set xrange [.1: 1] gnuplot> set yrange [.5: 2] gnuplot> set samples 4 gnuplot> plot R(x,.1), R(x, 1), R(x, 1) 14
Response of Linear Oscilator 1 1 D=.1 D=1 D=1 intensity 1.1.1.1 1e-4.1.1 1 1 1 normalized frequency 5: ( ) set logscale x y set xrange x y gnuplot> unsetset logscale gnuplot> set autoscale y 7.3 x y x y GNUPLOT t x = sin t + t, y = cos t gnuplot> set parametric dummy variable is t for curves, u/v for surfaces gnuplot> set trange [-5:5] gnuplot> set autoscale gnuplot> plot sin(t)+t, cos(t) set parametric plot unset parametric plot x y t t set trange set autoscale 2 plot x, y 15
2 sin(t)+t, cos(t) 2*sin(t)+t, 2*cos(t) Y -2-6 -4-2 2 4 6 X 6: 7.4 Kepler r = a(1 + e)/(1 + e cos θ) a e r θ e r e = e 1 r a a(1 + e)/(1 e) e 1 e e < 1 e = 1 4 2 e= e=.5 e=1 e=2 Y 4 2 2 4 2 4 X 7: gnuplot> Q(x, e) = (1+e)/(1+e*cos(x)) 16
Q(x, e) θ x gnuplot> unset grid gnuplot> unset parametric gnuplot> set polar gnuplot> set xrange [-3.14: 3.14] gnuplot> set yrange [-5: 5] gnuplot> plot Q(x,) title "e=", \ > Q(x,.5) title "e=.5",\ > Q(x,1) title "e=1", \ > Q(x,2) title "e=2" set polar plot set noparametric set yrange y plot title ( Windows Y= ) > 8 8.1 x y G(x, y) = e x2 e y2 = exp ( (x 2 + y 2 ) ) x =, y = x y G((x 1)/2, y) x 1 x 2 gnuplot> g(x,y) = exp(-x**2 - y**2) gnuplot> set xrange [-1:1] gnuplot> set yrange [-1:1] gnuplot> set zrange [:1.1] gnuplot> splot g(x/5,y/5) 4 gnuplot> set isosamples 4,4 ; replot 17
gnuplot> set hidden ; replot g(x-5,y+3,4,4) + g(x+5,y+3,4,4) +.6*g(x,y-3,2,2) 1.5 5 1-1 -5 5-1 -5 8: gnuplot> h(x,y,w) = g(x/w, y/w) gnuplot> splot h(x-5,y+3,4) + h(x+5,y+3,4) +.6*h(x,y-3,2) h(x,y,w).6 gnuplot> set view 45,3 gnuplot> replot x z z 8.2 gnuplot> set hidden gnuplot> set pm3d at s gnuplot> replot set pm3d at s set pm3d at bs set pm3d at b set pm3d at b unset surface 18
h(x-5,y+3,4) + h(x+5,y+3,4) +.6*h(x,y-3,2) 1.8.6.4.2 1.9.8.7.6.5.4.3.1.2-1 -5 5 1-1 -5 5 1 9: 8.3 set contour splot x-y set nosurface gnuplot> set contour gnuplot> unset surface gnuplot> set view, gnuplot> splot h(x-5,y+3,4) + h(x+5,y+3,4) +.6*h(x,y-3,2) B-Spline gnuplot> set isosamples 1,1 gnuplot> set samples 1,1 gnuplot> set cntrparam bspline gnuplot> set cntrparam levels 2 gnuplot> replot 19
1 1.9.8.7.6.5.4.3.2.1 5-5 -1-5 5 1-1 1: 9 GNUPLOT GNUPLOT 6.8 3 7.8 6 6. 7 5.1 1.4 8 4.2 9 2. 4 7.3 5 6.8 2 7.7 1 7.5 data1 ( mule ) GNUPLOT 2
gnuplot> plot "data1" gnuplot> plot 8 -.1*x**2, "data1" gnuplot> f(x) = a*x**2 + b*x + c gnuplot> a = -.1 gnuplot> b = gnuplot> c = 8 gnuplot> plot f(x), "data1" fit gnuplot> fit f(x) "data1" via a,b,c a, b, c gnuplot> print a,b,c 8 7 6 5 4 3 2 1 f(x) "data1" 2 4 6 8 1 11: ( ) 21