pgplot ø¹Ï°Æµ{¦¡®w

 

 

¦w¸Ë º[ «Øºc pgplot ªº¤èªk

 

¨ú±o®M¥ó

¨ú±o®M¥ó¡]¦b¦¹¥H pgplot 5.2 ª©¬°¨Ò¡^¡A±Ð«Ç¾÷¾¹¥Ø¿ý /NFS_home/pgplot/ ¤U¤]¦³©ñ¡A¦WºÙ¬O pgplot5.2.tar.gz ¡]¥t¥~ /NFS_home/pgplot/pgplot «h¬O pgplot ¥D¥Ø¿ý¡^¡Ccopy ¨ì¦Û¤wªº¥Ø¿ý¤U¡]¦p /NFS_home/u12345678¡^

PGPLOT ªº©x¤èºô¯¸¡Ghttp://www.astro.caltech.edu/~tjp/pgplot/

¥»¦a¡]²H¦¿¤j¾Ç¡^³sµ²ÂI pgplot5.2.tar.gz

 

·Ç³Æ¥Ø¿ý

¿ï¾Ü¤@­Ó¼È®É©ñ¸m­ì©l½X¥]ªº¥Ø¿ý¡]¥´ mkdir /NFS_home/u12345678/pgplot_source¡^¡A¨Ã§ó§ï¥Ø«e©Ò¦b¥Ø¿ý¦ì¸m¨ì³o­Ó¼È®É¥Ø¿ý¡]¥´ cd /NFS_home/u12345678/pgplot_source¡^¡A¥´¤U¦C«ü¥O¸Ñ¶} ¡]tar -zxf /NFS_home/u12345678/pgplot5.2.tar.gz¡^¡A¦p¦¹·|¦b /NFS_home/u12345678/pgplot_source ¥Ø¿ý¤U¦A¦h²£¥Í¤@­Ó pgplot ¥Ø¿ý¡A¤º¦³§¹«¬¾ãªº­ì©l½X®M¥ó¡C°ò¥»¤W¥ý­n¬ÝªºÅª§ÚÀɮ׬O aaaread.me¡A¦w¸Ë¨BÆJ«h¼g¦b install-unix.txt ¡C

 

½s¿è drivers.list ²M³æ

pgplot ¤ä´©¤£¦Pªºµe­±Åã¥Ü¤ÎÀɮ׿é¥X¤è¦¡¥i¨Ñ¿ï¾Ü¡A³o¬O³z¹L½s¿è drivers.list ²M³æ¨Ó¥´¶}©ÎÃö±¼ªº¡C¤£¦P§@·~¨t²ÎÀô¹Ò¤§¤ä´©«×¨Ã¤£¬Û¦P¡A³Ì¦n¿ï­è¦n°÷¥Îªº´N¦n¤F¡A¥HÁקK¿ï¨ì¬Y¨Ç¤£¤ä´©ªº driver¡A´N­n¦^¥h¶}Ãö±¼¦A­«°µ¡]©Ò¦³¿ï¾Üªº drivers ³£¦³¤ä´©¨ì¡A«Øºc pgplot Àô¹Òªº°Ê§@¤~·|¶i¦æ¤U¥h¡^¡C¤j®a¥i¥Î¦b vi ½s¿è drivers.list¡A«e­±¦³ "!" §½²Å¸¹ªº´N¥Nªí¸Ó¶µÃö³¬¡A§â "!" ¸¹§R°£´N¥Nªí¸Ó¶µ¥´¶}¡C§Ú­Ì¤@¯ë¦Ü¤Ö·|¿ï /NULL¡B/XWINDOW ¥H¤Î /XSERV¡C¦pªGµy«á¤U make «ü¥O¤§«á¦³¤£¯à§¹¦¨¦Ó¦³¿ù»~ªº¸Ü¡A¥i¸ÕµÛ§â¿ù»~°T®§¤¤´£¨ì¤§¦³Ãö«Yªº device Ãö±¼¦A­«°µ¡A¨Ò¦p¦³¨Ç¨t²Î¤£¤ä·½ /XDISP¡C

 

²£¥Í makefile ÀÉ

½s¿è§¹¤F drivers.list ²M³æ¤§«á¡A§Ú­Ì­n¿ï¾Ü¨Ã«Ø¥ß±N¨Ó pgplot ®M¥ó¦b¨t²Î¤¤¦s©ñªº¥Ø¿ý¡A¦pªG§A¦³ºÞ²zªÌÅv­­¡A«h©ñ¦b¤½¦@¥Ø¿ý¤j®a¥Î°_¨Ó·|¤ñ¸û¤è«K¡]¦p /usr/local/pgplot ¡^¡F­Y§A¨S¦³ºÞ²zªÌÅv­­¡A«h¦b¨Ï¥ÎªÌ¦Û¤v¥ô¦óªº¥Ø¿ý¤U³£¨S¦³Ãö«Y¡C¤ñ¤è»¡¡A§A¨M©w§¹¦¨«áªº pgplot ¥Ø¿ý­n©ñ¦b /NFS_home/u12345678/pgplot¡A«h¥ý¦b§Aªº $HOME ¥Ø¿ý¦ì¸m¤U«Ø¥ß pgplot ¥Ø¿ý¡]¥´ mkdir /NFS_home/u12345678/pgplot¡^¡AµM«á cd ¨ì¨º­Ó¥Ø¿ýùØ¡]¥´ cd /NFS_home/u12345678/pgplot¡^¡AµM«á¦b¸Ó¥Ø¿ý¤U¥´

/NFS_home/u12345678/pgplot_source/pgplot/makemake /NFS_home/u12345678/pgplot_source/pgplot linux

¤W­zªø«ü¥O¦³¤T­Ó³¡¤À¡A²Ä¤@­Ó¬O«ü¥O makemake ªº¦ì¸m¡]makemake ¬O pgplot §@ªÌ¼gªº¤@­Ó script¡A¥¦¨Ã¤£¬O¤@­Ó UNIX «ü¥O¡^¡A¥¦«e­±ªº¤@ªø¦ê¸ô®|¬O·íªì­ì©l½X®M¥ó¥]¸Ñ¶}ªº¼È©ñ¦ì¸m¡A²Ä¤G³¡¤À¬O­ì©l½X¥Ø¿ý¸ô®|¡A²Ä¤T­Ó³¡¤À¬O§@·~¨t²ÎÃþ§O¡A¦b¦¹µ¹ "linux"¡C¦pªG¦w¸Ëªº compiler ¤£¦P©Î¦h©ó¤@ºØ¦Ó¨Ï pgplot µLªk¦Û¦æ°»´ú§ä¨ì¥¦­nªº©Î¬O§A¯S§O·Q«ü©wªº¡A«h¤W­zªø«ü¥O«á­±¥i¦Aµ¹¤@­Ó°Ñ¼Æ¡A¸Ô²Ó»¡©ú½Ð¨£ install-unix.txt¡C

¥H¦³¦w¸Ë g77 ªº Fedora Linux ¬°¨Ò¡A¥i¿ï¾Ü :

/pg_src_dir/makemake /pg_src_dir linux g77_gcc_aout

¨ä¤¤ /pg_src_dir ¦b³oùØ¥Nªí¸Ñ¶}¤§ pgplot ­ì©l½X®M¥ó¥]©Ò¦bªº¦ì¸m¡C

¥H¦³¦w¸Ë gfortran ªº cygwin ¬°¨Ò¡A¥i¿ï¾Ü :

/home/u01/pg_src_dir/makemake /home/u01/pg_src_dir cygwin gfortran_gcc

¨ä¤¤ /home/u01/pg_src_dir ¦b³oùØ¥Nªí¸Ñ¶}¤§ pgplot ­ì©l½X®M¥ó¥]©Ò¦bªº¦ì¸m¡C

 

 

¤U make «ü¥O

¦pªG¤W­z "makemake ¸ô®| §@·~¨t²Î [½sĶ¾¹¿ï¶µ] " ¦³¦¨¥\¡A«h§A¦b¥Ø«e¥Ø¿ý¡]pgplot ¦w¸Ë¥Ø¿ý¡^¤U·|¬Ý¨ì¥H¤UÀÉ®×

drivers.list
grexec.f
prpckgl.inc
makefile
pgplot.inc
rgb.txt

¦A¨Ó¡A§A´N¥i¥H¦b¥Ø«e¥Ø¿ý¤U¥´ make ¡]make ¬O¤@­Ó­«­nªº UNIX «ü¥O¡A¦³¿³½ì¦P¾Ç½Ð¥´ man make ©Î°Ñ¦Ò½u¤W UNIX Ãã¨å¡^ ¡C¥¦·|®Ú¾Ú¥Ø¿ý¤Uªº makefile ¤@¨B¨B½sĶ©Ò¦³ pgplot ´£¨Ñªº°Æµ{¦¡¡A²£¥Íª«¥óÀÉ (*.o) ¨Ã¥[¥H²Õ¸Ë¦¨µ{¦¡®wÀÉ (library file) ªº®æ¦¡¡A§Ú­Ì¥D­n´N¬O­n¨º­Ó libpgplot.a ªº library ÀÉ¡C ¥t¥~¡A¥Ñ©ó§Ú­Ì¦³¿ï¾Ü /XWINDOW ©Î /XSERV¡A·|¦A¦h²£¥Í pgxwin_server ¥i°õ¦æÀÉ¡F¤S¦]¬°§Ú­Ì¤]¿ï¤F/XDISP¡A ·|¦A¦h²£¥Í pgdisp ¥i°õ¦æÀÉ¡C

Note : For Ubuntu (a kind of Linux Distribution) user, there will be error message :

PGPLOT¿ù»~°T®§
.//pgdispd/proccom.c:166: ¿ù»~¡G »P ¡umalloc¡v Ãþ«¬½Ä¬ð

¸Ñ¨M¤èªk¡G ±N proccom.c ªº line 166 µù¸Ñ±¼

 

¶]½d¨Òµ{¦¡´ú¸Õ

³Ì«á¡A§Ú­Ì¶]½d¨Òµ{¦¡¨Ó´ú¸Õ¬O§_§¹¥þ¦¨¥\¡C¬°¤FÅýÅã¥Üµ{¦¡ª¾¹D pgplot ªº¦w¸Ë¥Ø¿ý¦b¨ºùØ¡A¤~¯àŪ±o¨ì©Ò»ÝªºÀɮסA­º¥ý­n½T©wÀô¹ÒÅܼƦ³§â PGPLOT_DIR ©w¸q¦n¡A³o»Ý­n¦b csh/tcsh ¥´¤U¦C«ü¥O¡G

setenv PGPLOT_DIR /NFS_home/u12345678/pgplot

©Î sh/bash/ksh ¤U¥´¤U¦C«ü¥O¡G

set PGPLOT_DIR = /NFS_home/u12345678/pgplot ; export PGPLOT_DIR

µù¡G¦pªG§A¨S¦³³]¤W­zªº PGPLOT_DIR Àô¹ÒÅܼơA¥u­n§â pgxwin_server «þ¨©¨ì¨t²Î¤½¥Îªº¥i°õ¦æÀɥؿý ¦p /usr/bin ¤§¤U¡Aµ´¤j³¡¤Àªº¥\¯à¤]³£¯à¥¿±`°õ¦æ¡C

¶]½d¨Òµ{¦¡ªº¤èªk¡A¬O¥´¨äµ{¦¡ªº¦WºÙ¡A¦p ./pgdemo1¡]­Y¤£¦b¥Ø«e¥Ø¿ý¤U«h»Ý¥]§t¾A·íªº¸ô®|¡^¡C

¦pªG§Aªº shell ©ê«è¥¦§ä¤£¨ì libpgplot.so¡A«h§A¥i¥H¥ý¥´ tcsh ¦A¥´

setenv LD_LIBRARY_PATH /NFS_home/u12345678/pgplot

µM«á¦A°õ¦æ ./pgdemo1

µù¡G­Y¥¼³]©w PGPLOT_DIR ³o­ÓÀô¹ÒÅܼơ]¤èªk¨£¤W¡^¡A¦³¥i¯à¾É­P pgplot µLªkÅã¥Ü¤å¦r¡A¯S¦¹´£¿ô¡C

 

³]©w¨Ï¥ÎªÌµn¤Jªº¹w³]Àô¹Ò­È

«Ü¦h½ÆÂøªºµ{¦¡¡A¥Ñ©ó»Ý­n¨ä¯S©w¥Ø¿ý¤Uªº¨ä¥L¨ó¦P¤u¨ãµ{¦¡¤@°_¹B§@¡A©Î¬O»Ý­n¨ä¯S©w¥Ø¿ý¤Uªº¬Y¨Ç¸ê®Æ¡A¬Æ¦Ü¬O³]©w­È¡A¦]¦¹»Ý­n¨t²ÎÂÇ¥ÑÀô¹ÒÅܼƨӧi¶D¥Dµ{¦¡³o¨Ç¯S©wªº¥Ø¿ý¦b¨ºùØ¡C³oºØ´À¯S©wµ{¦¡³]©wÀô¹ÒÅܼƪº°Ê§@¡A©TµM¥i¥H¥Ñ¨Ï¥ÎªÌª½±µ¤U«ü¥O©Î¬O¼g¤@­Ó¦Û°Ê°õ¦æªº script ¨Ó¶i¦æ¡A¦ý³o¼Ë°µ¨Ï¥Î³£ªÌ³£¤´»Ý°O±o¥h¤U¤@­Ó©Î¤@¨Ç«ü¥O¡C¦pªG¨C¦¸¶i¤J¨t²Î³£§Æ±æ¦³¨º¼ËªºÀô¹ÒÅܼƳ]©w¡A«h¥i¦¸¦b shell ªº .cshrc ¦¨ .profile¡]©Î .login¡^

.profile ¬O¨C¦¸µn¤J¨t²Î®É­n°µªº°Ê§@¡A¦Ó .cshrc «h¬O¨C¦¸°_°Ê

¦pªG§A¥Îªº¬O bash¡A«h .bashrc »P .bash_profile ¬O¹ïµ¥©ó«eªÌªº¨â­ÓÀÉ¡C

.cshrc ¤Î .profile ½d¨Ò
http://phi.sinica.edu.tw/aspac/notes/94/N94002/
http://netlab.cse.yzu.edu.tw/~statue/freebsd/docs/aasir/ch18.pdf
http://ece.niu.edu.tw/~chu/download/doc/UNIX.txt

 

pgplot ¨Ï¥ÎªºÀô¹ÒÅܼƽd¨Ò

¥H S105 ¹q¸£±Ð«ÇªºÀô¹Ò¬°¨Ò¡]¨Ï¥Î csh / tcsh shell Àô¹Ò¡^¡G

set path = (/NFS_home/pgplot/pgplot $path)
setenv PGPLOT_DIR /NFS_home/pgplot/pgplot

setenv LD_LIBRARY_PATH /NFS_home/pgplot/pgplot

setenv PGPLOT_FONT /NFS_home/pgplot/pgplot/grfont.dat

§A¥i¥H§â³o­Ó script ¥s°µ set_pgplot.csh¡A¨C¦¸¨Ï¥Î pgplot «e¦b tcsh/csh ¤U¡]¹q¸£±Ð«Ç¨Ï¥ÎªÌ¹w³]ªº shell¡^¥´ source set_pgplot.csh §Y¥i¡C

¦Ü©ó¦b¦Ò¸Õ¥Îªº VMware Àô¹Ò¡A°£¤F«e­z¼Ð·Ç¤èªk¡]¨ä¤¤ -L /usr/local/pgplot -lpgplot ½Ð©ñ¦b¾ã¦æªº³Ì«á­±¡A¦b§Ú­Ì²{¦bªº¨t²Î¤¤¤ñ¸û®e©ö§ä±o¨ì¡^¡G

gfortran -o my_prog.x my_prog.f -L /usr/X11R6/lib -lX11 -L /usr/local/pgplot -lpgplot

¤§¥~¡A¤]¥i¥Î¥H¤U§@ªk¡G¥ý§â libpgplot.a ±q /usr/local/pgplot ©Î ~/examples ¥Ø¿ý copy ¨ì¥Ø«e¤u§@ªº¥Ø¿ý¨Ó¡A¦b½sĶÁåµ²®É«h§ï¤U¡]¥H¤U­n¥´¦b¦P¤@¦æ¡^

gfortran -o my_prog.x -L /usr/X11R6/lib -lX11 my_prog.f libpgplot.a

 

¦p¦ó¥Î¼¶¼g¤Î½sĶ¥i§Q¥Î pgplot ø¹Ïªº Fortran µ{¦¡

 

¼¶¼g

¾Ç²ß¦p¦ó¨Ï¥Î pgplot ³Ì¦nªº¤èªk¡A¬O¡G

(1) ½sĶ¨Ã°õ¦æ¨ä¤ºªþªº¤@¨t¦C½d¨Òµ{¦¡ pgdemo1.f ~ pgdemo17.f¡]¦b¥»½Òµ{µ¹¤j®aªºµêÀÀ¾÷¾¹¬O©ñ¸m¦b /usr/local/pgplot ¤U¡F¦b±Ð«Çªº¾÷¾¹¬O©ñ¸m¦b /NFS_home/pgplot/pgplot/examples ¤º¡A¦Û¦æ¦w¸ËªÌ½Ð¨ì pgplot ¥D¥Ø¿ý¤Uªº examples ¥Ø¿ý§ä¡^¡]«Ø¥ß§¹ pgplot Àô¹Ò¤Î°Æµ{¦¡®w«á·|¦Û°Ê²£¥Í pgdemo1 ~ pgdemo17 ¥i°õ¦æÀÉ¡A¦]¦¹¤]¥i¥H¥h copy ¹L¨Ó¦Ó¤£¥²¦Û¦æ½sĶ¡^¡AÆ[¬Ý¨ä¥\¯à®i¥Ü¡C¦A

(2) ¨ì¬ÛÃöµ{¦¡¤Î°Æµ{¦¡¤¤°Ñ¦Ò¨ä«ü¥O¡]ø¹Ï°Æµ{¦¡¡^¦WºÙ¤Î¨ä¨Ï¥Îªº¤è¦¡¡A¨Ã¦P®É

(3) ±q½u¤W¤â¥U¬d¸ß¸Ó«ü¥O¡]°Æµ{¦¡¡^¤¤¤§¦U°Ñ¼Æ·N¸q¤Î¥Îªkªººë½T©w¸q¡C

¥H pgdemo1.f ¤¤ªº EX01 ¬°¨Ò

EX01 code

¡A¨äµe¥X¤§®ÄªG¦p¤U¡G

pgdemo_EX01

½Ðª`·N¡A±q¥»½d¨Ò©Ò¾Ç¨ìªº¸gÅç¡A¤@­Ó³Ì²©öªº PGPLOT Fortran µ{¦¡¨ã¦³¥H¤U°ò¥»®æ¦¡¡G

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

...

call pgclos
end

 

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

program pg_test
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

 

½sĶªº«ü¥O

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

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

 

³Ì­«­n¤§°ò¥»«ü¥O

PGOPEN

³o¬O¤@­Ó¾ã¼Æ­È¨ç¼Æ¡A¤@³Q¹Bºâ´N·|¶}±ÒÅã¥Ü©Î¦L¥Xªº¤¶­±¡]§Y·íªì drivers.list ©Ò¥´¶}ªº¸Ë¸m¤§¤@¡^¡A¥¦ªº¤Þ¼Æ¬O¸Ë¸m¦WºÙªº¦r¦ê¡]§t«e­±ªº±×½u "/"¡A¦p "/xwin"¡^¡A¨äµ²ªGªº­È«hªí¥Ü¤¶­±¸Ë¸m¶}±Òªº¦¨¥\»P§_¡C¦pªG¬O¾ã¼Æ 0 «hªí¥Ü¶}±Ò¦¨¥\¡A«D¹s­È¥Nªí¥¢±Ñ¡C­n¨Ï¥Î PGPLOT ªºÃ¸¹Ï¥\¯à¤§«e¤@©w­n¥s¥Î³o­Ó¨ç¼Æ¡A¥H¤U¬°±`¥Îªº»yªk¥Ü½d¡G

INTEGER PGOPEN
...
IF (PGOPEN('?') .LE. 0) STOP


³oªí¥Ü¦V¨Ï¥ÎªÌ¸ß°Ý¿é¥Xªí¸mÃþ§O¡A¶}±Ò¥¢±Ñ«hµ{¦¡°±¤î¡C


integer pgopen
...
if (pgopen('/xwin') .le. 0) stop


³oªí¥Üª½±µ¨Ï¥Î /xwin ¸Ë¸m¡A¤£¥²¸ß°Ý¡C¤@¼Ë­Y¶}±Ò¥¢±Ñ«hµ{¦¡°±¤î¡C

 

PGENV

³]©wø¹ÏÀô¹Ò­È¡A¥]§tµøµ¡¤j¤p¤Î¤ñ¨Ò¡Bx ¶b y ¶b½d³ò¡B¥H¤Î®y¼Ð¶b¤§µeªk¡C

CALL PGENV (XMIN, XMAX, YMIN, YMAX, JUST, AXIS)

PGLAB

¦L¤W®y¼Ð¶b¤Î¹Ï­±¤W¤èªº¤å¦r¼Ðñ

CALL PGLAB (XLBL, YLBL, TOPLBL)

PGLINE

±qµ¹©wªº¤@®M N ­Ó­Èªº X(N) »P Y(N) ®y¼Ð°}¦C­ÈùØ¡A³sµ§µe¥Xª½½u¬q¡C

CALL PGLINE (N, X, Y)

PGPT

±qµ¹©wªº¤@®M N ­Ó­Èªº X(N) »P Y(N) ®y¼Ð°}¦C­ÈùØ¡A¤@¦¸µe¥X­Ó§O²Å¸¹ÂI¡C²Å¸¹¤§Ãþ«¬¥i¿ï¾Ü¡A¦p¤U¹Ï¡G

¥t¥i°Ñ¦Ò PGPNTS ¡A¨C§å²Å¸¹¥i¥H¤£¤@¼Ë¡C

 

PGCLOS

Ãö³¬¡C¦pªG¨S¦³¨Ï¥Î¡A«hø¹Ï¶]§¹«á¨ä¿Ã¹õ¤Wªº¹Ï§Î¤]ÀHµÛµ{¦¡°õ¦æªºµ²§ô¦Ó®ø¥¢¡A¨Ï¥Î PGCLOS Åý¨Ï¥ÎªÌ¦³¾÷·|¬Ý²M·¡¹Ï§Î«á¦AÃö¹Ï¡C

CALL PGCLOS

 

±`¥Ç¿ù»~¤§´£¿ô

pgenv ùتº x¡By ½d³ò¨Ï¥Î¤F¾ã¼Æ

pgenv ùتº x¡By ¤W¤U­­¡]§Y«e¥|­Ó¼Æ¦r¡^»~¶Ç¤F¾ã¼Æ©Î¾ã¼ÆÅܼƶi¥h¡A ¹Ï®Ø/¶b·|µe¤£¥X¨Ó¡C

µ{¦¡ªº³Ì«á¨S¥´ call pgclos

pgclos ·|µ¹¥X«ö Enter «áÃö³¬ªº´£¥Ü¡A¦b¹Ï­±®ø¥¢¤§«eµ¹¾Þ§@ªÌ¨¬°÷ªºÆ[¹î®É¶¡¡C­Y¥¼§@ call pgclos¡A«h°£«D¬Oµ{¦¡¥»¨­ÁÙ¦b¶]©Îµ¥«Ý¡A§_«hµ{¦¡¤@¥¹µ²§ô¡A«e¥ý«eµe¥Xªº¹Ï§Î´N·|°¨¤W®ø¥¢¡C

§Ñ°O«Å§i pgopen ¬°¾ã¼Æ

pgopen ¬O¤@­Ó¾ã¼Æ¨ç¼Æ¡A¤£¦P©ó¤j³¡¤À pgplot «ü¥O±Ä°Æµ{¦¡©I¥sªº¤è¦¡¡A ¦]¦¹»Ý­n«Å§i¨ä¬°¾ã¼Æ¡A§_«hµLªk°õ¦æ¡C

¨Sµ¹¥¿½Tªº¨ç¦¡®w¦WºÙ©Î¸ô®|

-L ©Î -l °Ñ¼Æ¨Sµ¹©Î X11 (­^¤å¦r¥À¤j¼g X ¤Î¼Æ¦r 11) ¥´¿ù¦r¡A·|³y¦¨¨ç¦¡®w³sµ²¤£¨ì¦Ó³y¦¨½sĶ¡]Ãìµ²¡^®É©ê«è¦³¨ÇªF¦è "reference" ¤£¨ì¦ÓµLªk²£¥Í¥i°õ¦æÀÉ¡C

 

¨ä¥L¦³¥Î¤§«ü¥O

PGSCI

³]©wÃC¦â (Set Color Index)¡A­I´º¦â¬O 0¡C

PGCURS

¦b·Æ¹««ü¼Ð©Ò¦bªº¥ô¸m±µ¥ô¤@¤å¦rÁä¥i¶Ç¦^¸Ó¦ì¸mªºµ´¹ï®y¼Ð¥H¤Î©Ò«öªº¦r²Å¡A¬O«Ü¦³¥Îªº¤¬°Ê¦¡¿é¤J¤u¨ã¡C

PGBAND

»P¤W­z«ü¥OÃþ¦ü¡A¥u¬O¦h¥[¤F·Æ¹««ü¼Ð¦b²¾°Ê®É¦³¤@±ø½u³sµÛ¤W¤@¦¸¿ï¨úªºÂI¡A"Elastic band §Y¾ó¥Öµ¬"¡C

PGPAP

³]©w¹Ï®Ø (¯È±i PAPer) ¤j¤p¡]­n¦b PGENV ¤§«e¨Ï¥Î¡^¡A©Òµ¹¤Jªº¨â­Ó¹ê¼Æ°Ñ¼Æ¤À§O¬O x ªºªø«×¥H¤Î y ¬Û¹ï©ó x ªºªø«×¤j¤p¡C¨Ò¦p¡A­Y­n§@¥X x Ãäªø¬O 5 ¦Tªº 4:3 ªºµe­±¡A«h©I¥s PGPAP (5.0, 0.75) ¡C

¥t¥~¡A¦p¦P¨ä¥L©Ò¦³ PGPLOT °Æµ{¦¡¡A¥Î¨ì¹ê¼Æ°Ñ¼Æªº¼Æ­È¡A¤@©w­n±a¦³¤p¼ÆÂI¡A¦]¦¹¤W¨Ò¤¤¤§ PGPAP (5.0, 0.75) ¤£¥i¥H¼g§@ PGPAP (5, 0.75)¡A½Ðª`·N¡C

PGCIRC

µe¶ê¡A¤T­Ó¹ê¼Æ°Ñ¼Æ¤À§O¬O x-®y¼Ð¡By-®y¼Ð¡A¥H¤Î¥b®|¡C

PGSFS

³]©w¶ñ¦âÄÝ©Ê (Set Fill-area Style)¡C·|¼vÅT PGCIRC¡BPGRECT¡BPGPOLY µe¥X¬OªÅ¤ßªº©Î¬O¶ñº¡ªº¡C

PGTEXT ¤Î PGPTXT

¦b¹Ï¤W¦L¥X¤å¦r

PGPANL

¤Á´«¨ì¹Ï­±¤W¤£¦Pªº­±ª©¡]¸g¥Ñ PGSUBP ©Î PGBEG ©Ò¤Á³Î¥X¨Óªº¡^

PGSLCT

¿ï¾Ü¿é¥X¸Ë¸m¡A¸Ë¸mªº¾ã¼Æ¸¹½X¬O¥Ñ¾ã¼Æ¨ç¼Æ PGOPEN ©Ò¶Ç¦^ªº­È¡C

 

¨ä¥L¦³½ì¤§«ü¥O

PGBBUF »P PGEBUF

½w½Ä°Ï¥\¯à¡C§â²³¦hø¹Ï°Ê§@§¨¦b PGBBUF »P PGEBUF ¤§¶¡¡A¯à¤j´T´£ª@ø¹Ï®Ä²v¡C

µù¡G³o¬O¦]¬°¥ô¦ó·s¹Ï¹³¦b¿Ã¹õ¤Wªº§e²{¡A³£¶·¸g¥Ñ CPU ¥ý±Nµe¯À¸ê®Æ¼g¤Jµø°T°O¾ÐÅé (Video RAM¡A¡A§YÅã¥Ü¥d¤Wªþ±aªº°O¾ÐÅé) ¡A¦A§ó·sÅã¥Ü¬°µe­±«G·tÂI ¡C¦]¦¹¾¨¥i¯à±N·s¤º®e³sÄò¼g¤Jµø°T°O¾ÐÅé¡A¦b¤@¦¸¨ê·s¡A·|¤ñ¸û¦³®Ä²v¡C

 

 

½sĶ»PÃìµ²

¦b¥»½Òµ{µ¹¤j®aªºµêÀÀ¾÷¾¹Àô¹Ò¤U¡A­n½sĶ¥Ø«e¥Ø¿ý¤Uªº pgdemo1.f ¡A­n¥´¡G

gfortran -o pgdemo1.x pgdemo1.f -L /usr/local/pgplot -lpgplot -lX11

³o¬O¦]¬° UNIX X-µøµ¡©Ò·|»Ý­nªº libX11.a ¤w¸g©ñ¦b¨t²Î¥i¨Ó·j´M±o¨ìªº¥Ø¿ý¤U¡C

 

¦pªG§A¨Ï¥Î cygwin¡A¨Ã°²©ñ¦w¸Ëªº¥Ø¿ý¬O¦b /usr/local/pgplot¡A«h¥i¯à­n§â°Æµ{¦¡®wÃìµ²²¾¸m¨ì«á­±¡A¦p¤U¡G

g77 -o pg.exe pg.f -L /usr/local/pgplot -lpgplot -lX11

 

¦b­pºâª«²z¹êÅç«Ç²{¦æªº¦w¸Ë³]©w¤U¡A¦b¦s©ñ§A¦Û¤wµ{¦¡¡]¦b¦¹¥H pgdemo1.f ¬°¨Ò¡^ªº¥Ø¿ý¤U¥´¡G

f77 -o pgdemo1.x -nobackshash -L/usr/X11R6/lib -lX11 -lpgplot pgdemo1.f

¨ä¤¤ -nobackslash °Ñ¼Æ¬O¬°¤FÅý¹Ïªº¼ÐÃD¤å¦r¥i¥HÅã¥Ü¤W¼Ð¡]¦¸¤è¡^¡A³o¦b pgplot ¤¤­n¥Î¨ì¤Ï±×½u "\" ²Å¸¹¡A¦b¦³¨Ç compiler ·|¸àÄÀ¤Ï±×½u²Å¸¹¦³¯S©w·N¸q¡A¦ý¦b¦¹¥u¬O pgplot ªº°Æµ{¦¡ùØÀY­n¥Î¡A¦]¦¹«ü©w no back-slash¡C ¡]­Y¬O g77 «h¬O -fno_back_slash¡^

¦pªG§A¨S¦³ºÞ²zªÌÅv­­¡A«h§Aªº libpgplot.a (©Î .so) Àɤ£·|¦b¨t²Î¤½¦@¥Ø¿ýùØ¡C³o®É­nÃìµ² pgplot °Æµ{¦¡®w«h»Ý­n¦b -lpgplot °Ñ¼Æªº«e­±µ¹¸ô®| -L/NFS_home/u12345678/pgplot ¡C

 


½u¤W¤â¥U

pgplot.html

©x¤èºô¯¸¨Ï¥Î»¡©ú¡Ghttp://www.astro.caltech.edu/~tjp/pgplot/contents.html

 

½d¨Òµ{¦¡

pgdemo1.f ¡@ª½±µ¬Ý­ì©l½X

³oùØ­±¦³«Ü¦h¥B­«­nªº¥\¯à¥Ü½d¡A¦³¦hºØø¹Ïªº§ÎºA¡C¨ä¤¤ EX01 ªº¥­­±§@¹Ï¥Ü½d¬O³Ì°ò¥»ªº¡A¤@©w­n·|¡C

 

pgdemo2.f ¡@ª½±µ¬Ý­ì©l½X

¥Ü½d¦â¶ô¡B¦r«¬¡B°O¸¹ªº¬¡¥Î¥H¤Î½u¼e¡B½u«¬ªºÅܤÆ

 

pgdemo3.f ¡@ª½±µ¬Ý­ì©l½X

¦UÃþ«¬µ¥°ª½uªºÃ¸»s

 

pgdemo4.f ¡@ª½±µ¬Ý­ì©l½X

¦âÃС]½Õ¦âªO¡^¥Ü½d

 

pgdemo5.f ¡@ª½±µ¬Ý­ì©l½X

¤ä´©¥H·Æ¹«¦b¥­­±¤W¨ú±oÂIªº¦ì¸m¥H¨Ñ¿é¤J¼Æ¾Úªº¥\¯à¡A¤]¤ä´©¦b¹Ï­±¤W«ö¤å¦rÁä·|¿ë»{¡C

 

pgdemo6.f ¡@ª½±µ¬Ý­ì©l½X

»P¤W¥Ü½dÃþ¦ü¡A¦ý§ó¼W¥[§Y®É¦Û«öÁäŪ¤J¦r¤¸ªº¥\¯à

 

pgdemo7.f ¡@ª½±µ¬Ý­ì©l½X

¥Ü½dÁôÂýuªºÃ¸¹Ï¥\¯à

 

pgdemo8.f ¡@ª½±µ¬Ý­ì©l½X

³o­Óµ{¦¡´£¨Ñ¤F¤@­Ó¤u¨ã°Æµ{¦¡¡A¥¦¯à§â¤@­Ó 3D ªº­±§ë¼v¦b 2D ¥­­±¤W¡C

 

pgdemo9.f ¡@ª½±µ¬Ý­ì©l½X

µe¯À¹ÏÀɪº¥Ü½d

 

pgdemo10.f ¡@ª½±µ¬Ý­ì©l½X

¤£¦P³¡¤À¹Ï¤§­I´º¦â¤]¥H§ïÅÜ

 

pgdemo11.f ¡@ª½±µ¬Ý­ì©l½X

°Êµe¥Ü½d¤Î¤ñ¸û

pgdemo12.f ¡@ª½±µ¬Ý­ì©l½X

¥H PGPAP §ïÅܹϮتº¤j¤p¡]«D±`¹ê¥Î¡^

pgdemo13.f ¡@ª½±µ¬Ý­ì©l½X

¥i¨Ï¥ÎÂù­«ªº device¡A¨Ã¥B¨ä¤¤¤@­Ó¥i¥H§@¬°¿ï³æªº¥Ü½d¡C¦P¤@±i¹Ï¤]¥i¥H¥]§t¦h­Ó¤p¹Ï¡C

 

pgdemo14.f ¡@ª½±µ¬Ý­ì©l½X

¦b¹Ï¤W´£¨Ñ¤@­Ó¥i¥H½s¿è¿é¤J°Ñ¼ÆªºÄæ¦ìµ¹µ{¦¡

 

pgdemo15.f ¡@ª½±µ¬Ý­ì©l½X

²£¥Í¹Ï¤§®É¶¡¡B¤é´Á¥H¤Î¨Ï¥ÎªÌ¤§¸ê°Tªº¦L¥X

 

pgdemo16.f ¡@ª½±µ¬Ý­ì©l½X

¦UÃþªø±ø¹Ï

 

pgdemo17.f ¡@ª½±µ¬Ý­ì©l½X

¥Ü½d 3D ´X¦óª«¥ó¤§Âà°Ê

 

À³¥Î½d¨Òµ{¦¡

staticel.f¡]¹q¤O½u¦Û°Ê®i¥Üµ{¦¡¡A»Ý¥s¥Î¶Ã¼Æ²£¥Í¾¹°Æµ{¦¡ ran3.f¡^

 

¨ä¥L¸ê·½

¨Ï¥Î PGPLOT §@¬°Ã¸¹Ï¤ÞÀºªº SPLASH ¤Ñ¤å³nÅ餧 FAQ
http://users.monash.edu.au/~dprice/splash/faq.html

PGplot ªº¦w¸Ë»P±Ð¾Ç¡AÃþ¦ü¥»ºô¯¸¡]­^¤å¡^¡A¦ý¦³¤£¦P½d¨Ò
http://www.ibiblio.org/pub/linux/docs/LDP/linuxfocus/English/November2002/article268.shtml

Ãö©ó¨Ï¥Î gif ®æ¦¡¹ÏÀɧ@¿é¥Xªº¤@¨Ç¸ê°T
http://www.astro.caltech.edu/~tjp/pgplot/gidriv.html