Environment variables controlling graphics from PGPLOT

R. Ghosh, July 2001


Default Directories and device types
X-window - /XSERV, /XTERM
X-window - /XDISP
PC-Windows - /W9
PostScript files /PS
GIF files /GIF
HP printer files /HJ
LaTeK files


These notes aim to bring together the many environment variables used in the PGPLOT library, concentrating specifically on the graphics devices in the ILL standard implementations.
unix :  % setenv PGPLOTenvname env_value
PCs  :  : SET PGPLOTenvname=env_value
VMS  :  $ DEF PGPLOTenvname "env_value"

a typical set would often be (unix)
setenv PGPLOT_XW_WIDTH 0.5
setenv PGPLOT_ILL_DEV_1 /xserv
setenv PGPLOT_ILL_DEV_2 /vcps
setenv PGPLOT_ILL_PPAGE 2
setenv PGPLOT_ILL_PGRUNFIGDISP figdisp
setenv PGPLOT_DIR /usr/ill/lib

Default Directories and device types

PGPLOT_DIR
This is the simplest single environment variable to be set to the directory containing the font file and graphics server programs.
Typically : % setenv PGPLOT_DIR /usr/ill/lib

PGPLOT_DEV

The default display output is sent to the null driver /NL. If this variable is set this becomes the default option.

PGPLOT_ILL_DEV_1
PGPLOT_ILL_DEV_2 etc.

Used by PGNOPN and PGOPN3 the first is used to designate a graphics screen device and the second (typically) a file device for printing hardcopy.

PGPLOT_ILL_PRINT_CMD

Used within PGNEND and PGEND3; conatins the print command (and possibly the printer name) to send the file to the designated printer when the graphics is terminated.

PGPLOT_ILL_PPAGE

Used by PGNOPN and PGOPN3 : if set to 2 then two pictures are drawn per page of hardcopy etc.

The following are rarely used:

PGPLOT_DEBUG	prints debug information
PGPLOT_PS_VERBOSE_TEXT   "
PGPLOT_TYPE	sets file type
PGPLOT_BUFFER turns on buffered output PGPLOT_BACKGROUND sets background colour PGPLOT_FORGROUND sets foreground colour

Device specific environment variables

X-window - /XSERV, /XTERM

PGPLOT_XW_WIDTH

This sets the graphics window as a fraction of the total screen width (e.g. set to 0.4 uses 40% of the screen for this new window). There are many other options in this software beyond this simple presentation.

X-window - /XDISP

PGPLOT_ILL_PGRUNFIGDISP set to command to run the figdisp program e.g. /usr/ill/bin/figdisp

PC-Windows /W9, /WV, /WS /WX /WZ

The letters correspond to VGA, SGA, XGA, ZGA graphics terminals, where the graphics window is sized to 640x480, 800x600 etc. More usefully:
PGPLOT_ILL_PX  can be set to the number of pixels in X
PGPLOT_ILL_PY  and Y  e.g. 400 and 300 respectively
(note: keep aspect ratio 4:3 x:y)

PostScript files /PS /VPS /CPS /VCPS

  PGPLOT_PS_WIDTH      default  7500  (a4)
  PGPLOT_PS_HEIGHT     default 11000  (a4)
  PGPLOT_PS_HOFFSET    default   350
  PGPLOT_PS_VOFFSET    default   250
PGPLOT_IDENT
If this variable is set, the user name, date and time are written in the bottom right corner of each page.

PGPLOT_PS_BBOX
If this variable has value MAX, PGPLOT puts standard (full-page) bounding-box information in the header of the PostScript file. If the variable is unset or has some other value, PGPLOT puts the correct (smallest) bounding box information in the trailer of the PostScript file.

PGPLOT_PS_EOF
Normally the output file does not contain special end-of-file characters. But if environment variable PGPLOT_PS_EOF is defined (with any value) PGPLOT writes a control-D job-separator character at the beginning and at the end of the file. This is appropriate for Apple LaserWriters using the serial interface, but it may not be appropriate for other PostScript devices.

PGPLOT_PS_MARKERS
Specify "NO" to suppress use of a PostScript font for the graph markers; markers are then emulated by line-drawing.

GIF files

PGPLOT_GIF_WIDTH   width of image in pixels
PGPLOT_GIF_HEIGHT  height of image in pixels

Programming note: if the common block variables are non-zero
these override the environment settings for the image size.
      COMMON /ILLGFC/ ILLGFW, ILLGFH

HP printer files /HJ - PC

LaTeK files /LX - PC

C   PGPLOT_HJ_MODE: use $ DEFINE PGPLOT_HJ_MODE HJnn
C
C     where nn is a number 1 - NDEV inclusive.  You may also use one of the
C     equivalent names listed below.
C       Thus  $ DEFINE PGPLOT_HJ_MODE HJ01
C        and  $ DEFINE PGPLOT_HJ_MODE LHOR  are equivalent (etc.)
C     The equivalent names are an attempt to make the driver names make
C     sense.  They are decoded as follows:
C
C        1st character: P for protrait orientation or
C                       L for landscape orientation.
C        2nd character: H for high resolution (300 dpi) or
C                       M for medium resolution (150 dpi) or
C                       L for low resolution (100 dpi).
C        3rd character: B for a straight bitmap dump (subroutine GRHJ01) or
C                       O for an optimized bitmap dump (subroutine GRHJ02).
C        4th character: R for a rectangular view surface or
C                       S for a square view surface.
C
C     A few notes are in order.  First, not all of the possible combinations
C     above are supported (currently).  The driver that goes by the name of
C     PHOT is a driver that puts out bitmaps suitable for inclusion in TeX
C     output if you are using the Arbortext DVIHP program.  The only drivers
C     that will work with unexpanded LaserJet are HJ08 and HJ09.  The other
C     seven drivers require a LaserJet Plus or LaserJet II.  Finally, do NOT
C     attempt to send grayscale plots to the drivers that use the optimized
C     bitmap dumps.  Terrible things will happen.
C
C       Driver  Equiv         Size (H x V)          Resolution
C       ------  -----     ---------------------    ----------
C        HJ01   LHOR        10.25 by  8.00 inches   300 DPI
C        HJ02   PHOR         8.00 by 10.25 inches   300 DPI
C        HJ03   PHOT         8.00 by 10.25 inches   300 DPI
C        HJ04   LHBR         6.54 by  4.91 inches   300 DPI
C        HJ05   PHBS         5.65 by  5.65 inches   300 DPI
C        HJ06   LMBR        10.25 by  8.00 inches   150 DPI
C        HJ07   PMBR         8.00 by 10.25 inches   150 DPI
C        HJ08   PMBS         4.48 by  4.48 inches   150 DPI
C        HJ09   PLBS         6.00 by  6.00 inches   100 DPI
C
C  The following logical names will override the PGPLOT_HJ_MODE settings,
C  if used.
C
C   PGPLOT_HJ_RES: use $ DEFINE PGPLOT_HJ_RES x  where x is H, M, L or V
C          H or HIGH     for 300 bpi
C          M or MEDIUM   for 150 bpi
C          L or LOW      for 100 bpi
C          V or VERYLOW  for  75 bpi
C
C   PGPLOT_HJ_MAR: use $ DEFINE PGPLOT_HJ_MAR  "xx.xx,yy.yy"
C       where "xx.xx" and "yy.yy" are the vertical and horizontal
C       margin dimensions in inches. The number of characters, including
C       spaces preceeding and following the comma, should not exceed five.
C         $ DEFINE PGPLOT_HJ_MAR  "1.0,1.0" is valid
C         $ DEFINE PGPLOT_HJ_MAR  " 1.0 ,1.0" is valid
C         but $ DEFINE PGPLOT_HJ_MAR  " 1.00 ,1.0" is not valid
C
C   PGPLOT_HJ_SIZE: use $ DEFINE PGPLOT_HJ_SIZE  "xx.xx,yy.yy"
C       where "xx.xx" and "yy.yy" are the vertical and horizontal
C       plot dimensions in inches. The number of characters, including
C       spaces preceeding and following the comma, should not exceed five.
C         $ DEFINE PGPLOT_HJ_SIZE  "10.,8." is valid
C         $ DEFINE PGPLOT_HJ_SIZE  "10.0 , 8.0 " is valid
C         but $ DEFINE PGPLOT_HJ_SIZE  " 10.0 ,8.0" is not valid
C
C   PGPLOT_HJ_TEX: use $ DEFINE PGPLOT_HJ_TEX  T
C         if PGPLOT_HJ_TEX is defined with any value, TeX mode (see above)
C         will be used.
C
C   PGPLOT_HJ_NOFF: use $ DEFINE PGPLOT_HJ_NOFF  T
C         if PGPLOT_HJ_NOFF is defined with any value, the form feed
C         needed to eject the final page will be omitted. This is useful
C         for spooled printers -- it prevents wasted (blank) pages.
C
C   PGPLOT_HJ_PAGE: use $ DEFINE PGPLOT_HJ_PAGE x  where x is L or P
C     Use L (or LANDSCAPE) for Landscape mode
C     Use P (or PORTRAIT) for Portrait mode
C
C   PGPLOT_HJ_OPT: use $ DEFINE PGPLOT_HJ_OPT x  where x is O or C
C     Use O (or OPTIMIZE) so that bitmap will be "optimized"
C     Use C (or COMPRESS) so that bitmap will be "compressed"
C
C       "Optimized" mode minimizes the memory usage for the LaserJet devices.
C       This sometimes leads to a larger file than if optimization is not
C       used. Optimized mode may not be used with the DeskJet devices.
C
C       "Compressed" mode decreases the size of the bitmap file for later
C       model HP devices, particularly the DeskJet devices.
C

LaTeK files /LATEX - PC