Skip to content

Category: Unix Hint

pgplot plotting routine for fortran and c

pgplot is in /usr/share/astro/pgplot/

for it to work correctly, one needs to set two environment variables, which can be done by putting the following two lines into the user’s .cshrc file:

setenv LD_LIBRARY_PATH /usr/share/astro/pgplot:/usr/local/lib
setenv PGPLOT_FONT /usr/share/astro/pgplot/grfont.dat

to compile and link a program with pgplot calls:

pglink.f77 programname for fortran 77 (do NOT include the “.f” extension in programname)
[formerly called linf77pgx]

pglink.f95 programname for fortran 95 (do NOT include the “.f90” extension in programname)
[currently the above invokes the g95 compiler/linker but expects that the source pgm has .f90 ext.]

pglink.c programname for c (do NOT include the “.c” extension in programname)
[formerly called lincpg, I think]

pglink.c.psr programname for c (do NOT include the “.c” extension in programname)
[formerly called lincpgpsr, I think] –links in starlink and psrcat routines in addition to pgplot. If this is ever used, paths in script will have to be updated. However George Hobbs said psrcat no longer needs separate starlink routines.

“locate ” to find a library etc

the way to find if a library or other file (?) is on sys is to say locate libpng

locate looks at a database so it is safer to first say updatedb which may take a while.
(note this is ~similar to “which “, which looks in your path for an executable.)