PGPLOT µ{¦¡Ã¸¹Ï¤Î°Êµeªº§Ö³t½d¨Ò

 

¨t²Î»Ý¨D

PGPLOT ¯à¦w¸Ëªº¥­¥x¡A¨Ò¦p ¦³ X-Window µøµ¡Àô¹Òªº LINUX / UNIX ©Î ¡]·L³nµøµ¡¤¤¥i¦w¸Ëªº¡^Cygwin ªº¨t²Î¡C

 

½sĶ¤èªk

¼g¤@­Ó Fortran µ{¦¡¡AùØ­±°£¤F¥»¨Ó´N­n¦³ªº¿é¥X¤J¡B¹Bºâµ¥«ü¥O¥~¡A¦A°t¦Xø¹Ï±M¥Îªº pgplot «ü¥O¡A§¹¦¨«á¡A¥H¤U¦C«ü¥O½sĶ¡G

gfortran pg_test.f -L /usr/local/pgplot -lpgplot -lX11

«h¥´ ./a.out <Enter> ´N¥i¥H°õ¦æ¡C

 

°ò¥»µ{¦¡®Ø¬[

program pg_test
integer pgopen
real xmin, xmax, ymin, ymax
if (pgopen('/xwin') .le. 0) stop
call pgenv(xmin,xmax,ymin,ymax,0,0)

...¡]¨ä¥L¤º®e¡^...

call pgclos
end

©Î¬O

program pg_test
integer pgopen, iostat
real xmin, xmax, ymin, ymax
iostat = pgopen('/xwin')
if (iostat .le. 0) stop

call pgenv(xmin,xmax,ymin,ymax,0,0)

...¡]¨ä¥L¤º®e¡^...

call pgclos
end

 

§Ö³t½d¨Ò

µe¤@­ÓÂI

¦b x, y ¬° [-1,1] ªº½d³ò¤º¡A±N¤@­ÓÂI¥H "1 ¸¹" ²Å¸¹µe¦b (x,y) = (0.5, 0.4) ªº¦ì¸m

program pg_one_point
integer pgopen
real xmin, xmax, ymin, ymax, x, y
if (pgopen('/xwin') .le. 0) stop

xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0

x = 0.5
y = 0.4

call pgenv(xmin,xmax,ymin,ymax,0,0)
call pgpt(1,x,y,1)

call pgclos
end

 

µe¦h­ÓÂI

¤@¦¸µe¤T­ÓÂI¡A¦b x, y ¬° [-1,1] ªº½d³ò¤º¡A±N¨º¤T­ÓÂI¥H "9 ¸¹" ²Å¸¹µe¦b (x,y) = (0.2, 0.2) (x,y) = (-0.4, -0.4) (x,y) = (0.6, 0.6) ªº¦ì¸m

program pg_multi_points
integer pgopen
real xmin, xmax, ymin, ymax, x(3), y(3)
if (pgopen('/xwin') .le. 0) stop

xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0

x(1) = 0.2
y(1) = 0.2
x(2) = -0.4
y(2) = -0.4
x(3) = 0.6
y(3) = 0.6

call pgenv(xmin,xmax,ymin,ymax,0,0)
call pgpt(3,x,y,9)

call pgclos
end

 

µe¤@±ø½u

program pg_one_line
integer pgopen
real xmin, xmax, ymin, ymax, x(2), y(2)
if (pgopen('/xwin') .le. 0) stop

xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0

x(1) = 0.0
y(1) = 0.0
x(2) = 1.0
y(2) = 1.0

call pgenv(xmin,xmax,ymin,ymax,0,0)
call pgline(2,x,y)

call pgclos
end

 

¦hÂI³s½u

¥H¦hÂI³s½u¬qªº¤è¦¡µe¥X¤T­ÓÂI (-0.2, 0.2), (0.0, 0.0), (0.6, 0.6) ªº³s½u

program pg_poly_line
integer pgopen
real xmin, xmax, ymin, ymax, x(3), y(3)
if (pgopen('/xwin') .le. 0) stop

xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0

x(1) = -0.2
y(1) = 0.2
x(2) = 0.0
y(2) = 0.0
x(3) = 0.6
y(3) = 0.6

call pgenv(xmin,xmax,ymin,ymax,0,0)
call pgline(3,x,y)

call pgclos
end

 

µe¤@­Ó¶ê

¤@­Ó²³æªº½d¨Òµ{¦¡ pg_test_circle.f ¡A¦b x, y ¦U¬° [-5,5] ½d³ò¤ºµe¤@­Ó¤¤¤ß¦b­ìÂI¡B¥b®| 2 ªº¶ê¡C

program pg_test_circle
integer pgopen
real xmin, xmax, ymin, ymax
if (pgopen('/xwin') .le. 0) stop

xmin = -5.0
xmax = 5.0
ymin = -5.0
ymax = 5.0

call pgenv(xmin,xmax,ymin,ymax,0,0)
call pgcirc(0.0,0.0,2.0)

call pgclos
end

 

 

 

 

¾Þ§@¤èªk

 

 

 

°ò¥»«ü¥O

¡]¨ú¦Û¥»¤H±Ð§÷¡^

½Ð¨£ ³sµ²

 

¶i¶¥½d¨Ò

°Êµe¥\¯à

ÃöÁä§Þ¥©¡Gºâ¥Xª«¥óªº·s¦ì¸m«á¡A¦b¦ì¸m¥Î­I´º¦â§âª«¥ó¶î±¼¡AµM«á¦b·s¦ì¸m¤Wµe¤Wª«¥ó¡C

PGPLOT ¼gªº°Êµeµ{¦¡½d¨Ò¡A planet.f

·Æ¹«¥\¯à

 

«öÁä¥\¯à

©Ò¿×ªº«öÁä¥\¯à¡A

¦hµøµ¡¡B¦h¸Ë¸m

 

 

½u¤W¤â¥U

³sµ² http://163.13.111.54/numerical_methods/pgplot/doc/pgplot.html

§õ©ú¾Ë¦Ñ®vªº¸Ô²Ó PGPLOT ±Ð¾Ç http://163.13.111.54/numerical_methods/nm_units/pgplot.htm