PGPLOT Plotting Subroutine Library

PGPLOT is a very full-featured graphics program that comes to us through the Astronomy community. It is in continuous development and is now up to version 5.2.

Fortran

To compile a Fortran program with these subroutines, add the following lines to your .profile file:

LD_LIBRARY_PATH=/usr/openwin/lib:/usr/local/lib
PGPLOT_DIR=/usr/local/lib/pgplot
PGPLOT_FONT=/usr/local/lib/pgplot/grfont.dat
PGPLOT_LIB="-lpgplot -lX11 -lsocket -lnsl"
export PGPLOT_DIR PGPLOT_FONT PGPLOT_LIB LD_LIBRARY_PATH

Then you will compile with
f77 program.f -o program $PGPLOT_LIB
where program.f is the name of the program. The executable will have the same name (without the suffix).

C

To use these with C programs,add the following lines to your .profile file:

LD_LIBRARY_PATH=/usr/openwin/lib:/usr/local/lib
PGPLOT_DIR=/usr/local/lib/pgplot
PGPLOT_FONT=/usr/local/lib/pgplot/grfont.dat
PGPLOT_LIB="-lcpgplot -lX11 -lsocket -lnsl"
export PGPLOT_DIR PGPLOT_FONT PGPLOT_LIB LD_LIBRARY_PATH

You need to include the header file "cpgplot.h", which is in /usr/local/include. A sample compilation would look like
cc program.c -o program -I/usr/local/include $PGPLOT_LIB

Output Devices

PGPLOT is capable of producing plots for interactive or non-interactive devices. Telnet users will need to have a Telnet program that is capable of showing a graphics window. Our currently recommended telnet program is TeraTerm, which is available from the Software Download Library. The graphics device recommended for TeraTerm is /TEK4010. To see the graphics window on TeraTerm, select the "Open TEK" option under the "Control" menu along the top bar of TeraTerm. Run all graphics programs in the TEK window. To return to the normal "VT" window, select VT-window" on the top bar of the TEK window. Run all normal commands and do all editing in the VT window.

Users of X-Windows can display plots using the xterm. Select the device "/xterm" and the windows switching will be done automatically.

The following is the list of currently available devices.

Interactive devices:

  • /TEK4010 (Tektronix 4010 terminal)
  • /GTERM (Color gterm terminal emulator)
  • /XTERM (XTERM Tek terminal emulator)
  • /XDISP (pgdisp or figdisp server)
  • /XWINDOW (X window window@node:display.screen/xw)
  • /XSERVE (A /XWINDOW window that persists for re-use)

Non-interactive file formats:

  • /GIF (Graphics Interchange Format file, landscape orientation)
  • /VGIF (Graphics Interchange Format file, portrait orientation)
  • /HJ
  • /LJ04 (LHBR)
  • /LATEX (LaTeX picture environment)
  • /FILE (PGPLOT graphics metafile)
  • /NULL (Null device, no output)
  • /PGMF (PGPLOT metafile)
  • /PPM (Portable Pixel Map file, landscape orientation)
  • /VPPM (Portable Pixel Map file, portrait orientation)
  • /PS (PostScript file, landscape orientation)
  • /VPS (PostScript file, portrait orientation)
  • /CPS (Colour PostScript file, landscape orientation)
  • /VCPS (Colour PostScript file, portrait orientation)
  • /TX
  • /WD (X Window Dump file, landscape orientation)
  • /VWD (X Window Dump file, portrait orientation)

Resources

To assist you in using the subroutines we have made Web versions of the demonstration programs as well as the help files available.

For a more complete source of information you can go to the PGPLOT author's web site.