home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / pgplot_1 / HelpPGPLOT < prev    next >
Text File  |  1997-06-17  |  190KB  |  4,843 lines

  1. %GRAREA
  2.  define a clipping window
  3.      SUBROUTINE GRAREA (IDENT,X0,Y0,XSIZE,YSIZE)
  4.  
  5.  GRPCKG: Define a rectangular window in the current plotting area. All
  6.  graphics (except characters written with GRCHAR) will be blanked
  7.  outside this window.  The default window is the full plotting area
  8.  defined by default or by GRSETS.
  9.  
  10.  Arguments:
  11.  
  12.  IDENT (input, integer): the plot identifier, returned by GROPEN.
  13.  X0, Y0 (input, real): the lower left corner of the window, in absolute
  14.        device coordinates.
  15.  XSIZE, YSIZE (input, real): width and height of the window in absolute
  16.        coordinates; if either is negative, the window will be reset to
  17.        the full plotting area.
  18.  
  19. %GRBPIC
  20.  begin picture
  21.      SUBROUTINE GRBPIC
  22.  
  23.  GRPCKG (internal routine). Send a "begin picture" command to the
  24.  device driver, and send commands to set deferred attributes (color,
  25.  line width, etc.)
  26.  
  27. %GRCHAR
  28.  draw a string of characters
  29.      SUBROUTINE GRCHAR (IDENT,CENTER,ORIENT,ABSXY,X0,Y0,STRING)
  30.  
  31.  GRPCKG: Draw a string of characters. The plot is not windowed
  32.  in the current subarea, but in the full plotting area.
  33.  
  34.  Arguments:
  35.  
  36.  IDENT (input, integer): plot identifier, as returned by GROPEN.
  37.  CENTER (input, logical): if .TRUE., the first character of the string
  38.       is centered at (X0,Y0); otherwise the bottom left corner of the
  39.       first character is placed at (X0,Y0).
  40.  ORIENT (input, real): the angle in degrees that the string is to make
  41.       with the horizontal, increasing anticlockwise.
  42.  ABSXY (input, logical): if .TRUE., (X0,Y0) are absolute device
  43.       coordinates; otherwise they are world coordinates (the scaling
  44.       transformation is applied).
  45.  X0, Y0 (input, real): position of first character (see CENTER).
  46.  STRING (input, character): the string of ASCII characters; control
  47.       characters 0-20 have special representations; all other
  48.       non-graphic characters are plotted as blank spaces.
  49.  
  50.  (1-Feb-1983)
  51.  
  52. %GRCHR0
  53.  support routine for GRCHAR and GRMARK
  54.      SUBROUTINE GRCHR0 (WINDOW,CENTER,ORIENT,ABSXY,X0,Y0,STRING)
  55.  
  56.  GRPCKG (internal routine): Support routine for GRCHAR and GRMARK.
  57.  Draw a string of characters.
  58.  
  59.  Arguments:
  60.  
  61.  WINDOW (input, logical): if .TRUE., the plot is windowed in the
  62.       current window.
  63.  CENTER (input, logical): if .TRUE., the first character of the string
  64.       is centered at (X0,Y0); otherwise the bottom left corner of the
  65.       first character is placed at (X0,Y0).
  66.  ORIENT (input, real): the angle in degrees that the string is to make
  67.       with the horizontal, increasing anticlockwise.
  68.  ABSXY (input, logical): if .TRUE., (X0,Y0) are absolute device
  69.       coordinates; otherwise they are world coordinates (the scaling
  70.       transformation is applied).
  71.  X0, Y0 (input, real): position of first character (see CENTER).
  72.  STRING (input, character): the string of ASCII characters; control
  73.       characters 0-20 have special representations; all other
  74.       non-graphic characters are plotted as blank spaces.
  75.  
  76.  (1-Mar-1983)
  77.  
  78. %GRCHSZ
  79.  inquire default character attributes
  80.      SUBROUTINE GRCHSZ (IDENT,XSIZE,YSIZE,XSPACE,YSPACE)
  81.  
  82.  GRPCKG: Obtain the default character attributes.
  83.  
  84.  Arguments:
  85.  
  86.  IDENT (input, integer): the plot identifier, returned by GROPEN.
  87.  XSIZE, YSIZE (output, real): the default character size
  88.       (absolute device units).
  89.  XSPACE, YSPACE (output, real): the default character spacing
  90.       (absolute units); XSPACE is the distance between the lower left
  91.       corners of adjacent characters in a plotted string; YSPACE
  92.       is the corresponding vertical spacing.
  93.  
  94. %GRCLIP
  95.  clip a point against clipping rectangle
  96.      SUBROUTINE GRCLIP (X,Y,XMIN,XMAX,YMIN,YMAX,C)
  97.      REAL X,Y
  98.      REAL XMIN,XMAX,YMIN,YMAX
  99.      INTEGER C
  100.  
  101.  GRPCKG (internal routine): support routine for the clipping algorithm;
  102.  called from GRLIN0 only. C is a 4 bit code indicating the relationship
  103.  between point (X,Y) and the window boundaries; 0 implies the point is
  104.  within the window.
  105.  
  106.  Arguments:
  107.  
  108. %GRCLOS
  109.  close graphics device
  110.      SUBROUTINE GRCLOS
  111.  
  112.  GRPCKG: Close the open plot on the current device. Any pending output
  113.  is sent to the device, the device is released for other users or the
  114.  disk file is closed, and no further plotting is allowed on the device
  115.  without a new call to GROPEN.
  116.  
  117.  Arguments: none.
  118.  
  119. %GRCLPL
  120.  clip line against clipping rectangle
  121.      SUBROUTINE GRCLPL (X0,Y0,X1,Y1,VIS)
  122.  
  123.  GRPCKG (internal routine): Change the end-points of the line (X0,Y0)
  124.  (X1,Y1) to clip the line at the window boundary.  The algorithm is
  125.  that of Cohen and Sutherland (ref: Newman & Sproull).
  126.  
  127.  Arguments:
  128.  
  129.  X0, Y0 (input/output, real): device coordinates of starting point
  130.        of line.
  131.  X1, Y1 (input/output, real): device coordinates of end point of line.
  132.  VIS (output, logical): .TRUE. if line lies wholly or partially
  133.        within the clipping rectangle; .FALSE. if it lies entirely
  134.        outside the rectangle.
  135.  
  136. %GRCTOI
  137.  convert character string to integer
  138.      INTEGER FUNCTION GRCTOI (S, I)
  139.      CHARACTER*(*) S
  140.      INTEGER I
  141.  
  142.  GRCTOI: attempt to read an integer from a character string, and return
  143.  the result. No attempt is made to avoid integer overflow. A valid
  144.  integer is any sequence of decimal digits.
  145.  
  146.  Returns:
  147.   GRCTOI           : the value of the integer; if the first character
  148.                     read is not a decimal digit, the value returned
  149.                     is zero.
  150.  Arguments:
  151.   S      (input)  : character string to be parsed.
  152.   I      (in/out) : on input, I is the index of the first character
  153.                     in S to be examined; on output, either it points
  154.                     to the next character after a valid integer, or
  155.                     it is equal to LEN(S)+1.
  156.  
  157.  
  158. %GRCURS
  159.  read cursor position
  160.      INTEGER FUNCTION GRCURS (IDENT,IX,IY,IXREF,IYREF,MODE,POSN,CH)
  161.      INTEGER IDENT, IX, IY, IXREF, IYREF, MODE, POSN
  162.      CHARACTER*(*) CH
  163.  
  164.  GRPCKG: Read the cursor position and a character typed by the user.
  165.  The position is returned in absolute device coordinates (pixels).
  166.  GRCURS positions the cursor at the position specified, and
  167.  allows the user to move the cursor using the joystick or
  168.  arrow keys or whatever is available on the device. When he has
  169.  positioned the cursor, the user types a single character on his
  170.  keyboard; GRCURS then returns this character and the new cursor
  171.  position.
  172.  
  173.  "Rubber band" feedback of cursor movement can be requested (although
  174.  it may not be supported on some devices). If MODE=1, a line from
  175.  the anchor point to the current cursor position is displayed as
  176.  the cursor is moved. If MODE=2, a rectangle with vertical and
  177.  horizontal sides and one vertex at the anchor point and the opposite
  178.  vertex at the current cursor position is displayed as the cursor is
  179.  moved.
  180.  
  181.  Returns:
  182.  
  183.  GRCURS (integer): 1 if the call was successful; 0 if the device
  184.       has no cursor or some other error occurs.
  185.  
  186.  Arguments:
  187.  
  188.  IDENT (integer, input):  GRPCKG plot identifier (from GROPEN).
  189.  IX    (integer, in/out): the device x-coordinate of the cursor.
  190.  IY    (integer, in/out): the device y-coordinate of the cursor.
  191.  IXREF (integer, input):  x-coordinate of anchor point.
  192.  IYREF (integer, input):  y-coordinate of anchor point.
  193.  MODE  (integer, input):  type of rubber-band feedback.
  194.  CH    (char,    output): the character typed by the user; if the device
  195.       has no cursor or if some other error occurs, the value CHAR(0)
  196.       [ASCII NUL character] is returned.
  197.  
  198. %GRDAT2
  199.  character set definition (block data)
  200.      BLOCK DATA GRDAT2
  201.  
  202.  GRPCKG (internal routine): Block data for to define the character set.
  203.  
  204.  Arguments: none.
  205.  
  206.  (1-Feb-1983)
  207.  
  208. %GRDOT0
  209.  draw a dot
  210.      SUBROUTINE GRDOT0 (X,Y)
  211.  
  212.  GRPCKG (internal routine): Draw a single dot (pixel) at a specified
  213.  location.
  214.  
  215.  Arguments:
  216.  
  217.  X, Y (real, input): absolute device coordinates of the dot (these
  218.        are rounded to the nearest integer by GRDOT0).
  219.  
  220. %GRDOT1
  221.  draw dots
  222.      SUBROUTINE GRDOT1(POINTS, X, Y)
  223.      INTEGER POINTS
  224.      REAL X(POINTS), Y(POINTS)
  225.  
  226.  GRPCKG (internal routine): Draw a set of dots.
  227.  
  228.  Arguments:
  229.  
  230.  POINTS (input, integer): the number of coordinate pairs.
  231.  X, Y (input, real arrays, dimensioned POINTS or greater): the
  232.        X and Y world coordinates of the points.
  233.  
  234. %GRDTYP
  235.  decode graphics device type string
  236.      INTEGER FUNCTION GRDTYP (TEXT)
  237.  
  238.  GRPCKG (internal routine): determine graphics device type code from
  239.  type name. It compares the argument with the table of known device
  240.  types in common.
  241.  
  242.  Argument:
  243.  
  244.  TEXT (input, character): device type name, eg 'PRINTRONIX'; the name
  245.        may be abbreviated to uniqueness.
  246.  
  247.  Returns:
  248.  
  249.  GRDTYP (integer): the device type code, in the range 1 to
  250.        GRTMAX, zero if the type name is not recognised, or -1
  251.        if the type name is ambiguous.
  252.  
  253. %GREPIC
  254.  end picture
  255.      SUBROUTINE GREPIC
  256.  
  257.  GRPCKG: End the current picture.
  258.  
  259.  Arguments: none.
  260.  
  261. %GRESC
  262.  escape routine
  263.      SUBROUTINE GRESC (TEXT)
  264.  
  265.  GRPCKG: "Escape" routine. The specified text is sent directly to the
  266.  selected graphics device, with no interpretation by GRPCKG. This
  267.  routine must be used with care; e.g., the programmer needs to know
  268.  the device type of the currently selected device, and the instructions
  269.  that that device can accept.
  270.  
  271.  Arguments: none.
  272.   TEXT (input, character*(*)):  text to be sent to the device.
  273.  
  274.  15-May-1985 - new routine [TJP].
  275.  26-May-1987 - add GREXEC support [TJP].
  276.  19-Dec-1988 - start new page if necessary [TJP].
  277.   4-Feb-1997 - RBUF should be an array, not a scalar [TJP].
  278.  
  279. %GRETXT
  280.  erase text from graphics screen
  281.      SUBROUTINE GRETXT
  282.  
  283.  GRPCKG: Erase the text screen.  Some graphics devices have
  284.  two superimposed view surfaces, of which one is used for graphics and
  285.  the other for alphanumeric text.  This routine erases the text
  286.  view surface without affecting the graphics view surface. It does
  287.  nothing if there is no text view surface associated with the device.
  288.  
  289.  Arguments: none.
  290.  
  291. %GRFA
  292.  fill area (polygon)
  293.      SUBROUTINE GRFA (N,PX,PY)
  294.      INTEGER N
  295.      REAL PX(*), PY(*)
  296.  
  297.  GRPCKG: FILL AREA: fill a polygon with solid color.  The polygon
  298.  is defined by the (x,y) world coordinates of its N vertices.  If
  299.  this is not a function supported by the device, shading is
  300.  accomplished by drawing horizontal lines spaced by 1 pixel.  By
  301.  selecting color index 0, the interior of the polygon can be erased
  302.  on devices which permit it.  The polygon need not be convex, but if
  303.  it is re-entrant (i.e., edges intersect other than at the vertices),
  304.  it may not be obvious which regions are "inside" the polygon.  The
  305.  following rule is applied: for a given point, create a straight line
  306.  starting at the point and going to infinity. If the number of
  307.  intersections between the straight line and the polygon is odd, the
  308.  point is within the polygon; otherwise it is outside. If the
  309.  straight line passes a polygon vertex tangentially, the
  310.  intersection  count is not affected. The only attribute which applies
  311.  to FILL AREA is color index: line-width and line-style are ignored.
  312.  There is a limitation on the complexity of the polygon: GFA will
  313.  fail if any horizontal line intersects more than 32 edges of the
  314.  polygon.
  315.  
  316.  Arguments:
  317.  
  318.  N (input, integer): the number of vertices of the polygon (at least
  319.        3).
  320.  PX, PY (input, real arrays, dimension at least N): world coordinates
  321.        of the N vertices of the polygon.
  322.  
  323. %GRFAO
  324.  format character string containing integers
  325.      SUBROUTINE GRFAO (FORMAT, L, STR, V1, V2, V3, V4)
  326.      CHARACTER*(*) FORMAT
  327.      INTEGER L
  328.      CHARACTER*(*) STR
  329.      INTEGER V1, V2, V3, V4
  330.  
  331.  The input string FORMAT is copied to the output string STR with
  332.  the first occurrence of '#' replaced by the value of V1, the second
  333.  by the value of V2, etc.  The length of the resulting string is
  334.  returned in L.
  335.  
  336. %GRGFIL
  337.  find data file
  338.      SUBROUTINE GRGFIL(TYPE, NAME)
  339.      CHARACTER*(*) TYPE, NAME
  340.  
  341.  This routine encsapsulates the algorithm for finding the PGPLOT
  342.  run-time data files.
  343.  
  344.  1. The binary font file: try the following in order:
  345.      file specified by PGPLOT_FONT
  346.      file "grfont.dat" in directory specified by PGPLOT_DIR
  347.                        (with or without '/' appended)
  348.      file "grfont.dat" in directory /usr/local/pgplot/
  349.  
  350.  2. The color-name database: try the following in order:
  351.      file specified by PGPLOT_RGB
  352.      file "rgb.txt" in directory specified by PGPLOT_DIR
  353.                        (with or without '/' appended)
  354.      file "rgb.txt" in directory /usr/local/pgplot/
  355.  
  356.  Arguments:
  357.   TYPE (input)  : either 'FONT' or 'RGB' to request the corresponding
  358.                   file.
  359.   NAME (output) : receives the file name.
  360.  
  361. %GRGRAY
  362.  gray-scale map of a 2D data array
  363.      SUBROUTINE GRGRAY (A, IDIM, JDIM, I1, I2, J1, J2,
  364.     1                   FG, BG, PA, MININD, MAXIND, MODE)
  365.      INTEGER IDIM, JDIM, I1, I2, J1, J2, MININD, MAXIND, MODE
  366.      REAL    A(IDIM,JDIM)
  367.      REAL    FG, BG
  368.      REAL    PA(6)
  369.  
  370.  This is a device-dependent support routine for PGGRAY.
  371.  
  372.  Draw gray-scale map of an array in current window. Array
  373.  values between FG and BG are shaded in gray levels determined
  374.  by linear interpolation. FG may be either less than or greater
  375.  than BG.  Array values outside the range FG to BG are
  376.  shaded black or white as appropriate.
  377.  
  378.  GRGRAY uses GRIMG0 on devices with enough color indices available.
  379.  Note that it changes the color table to gray-scale.
  380.  Otherwise in does a random dither with GRIMG3.
  381.  
  382.  Arguments:
  383.   A      (input)  : the array to be plotted.
  384.   IDIM   (input)  : the first dimension of array A.
  385.   JDIM   (input)  : the second dimension of array A.
  386.   I1, I2 (input)  : the inclusive range of the first index
  387.                     (I) to be plotted.
  388.   J1, J2 (input)  : the inclusive range of the second
  389.                     index (J) to be plotted.
  390.   FG     (input)  : the array value which is to appear in
  391.                     foreground color.
  392.   BG     (input)  : the array value which is to appear in
  393.                     background color.
  394.   PA     (input)  : transformation matrix between array grid and
  395.                     device coordinates (see GRCONT).
  396.   MODE   (input)  : transfer function.
  397.  
  398. %GRGTC0
  399.  obtain character digitization
  400.      SUBROUTINE GRGTC0 (CHAR,CENTER,POINTS,X,Y,MORE)
  401.  
  402.  GRPCKG (internal routine): obtain character digitization.
  403.  
  404.  (10-Feb-1983)
  405.  
  406. %GRIMG0
  407.  color image of a 2D data array
  408.      SUBROUTINE GRIMG0 (A, IDIM, JDIM, I1, I2, J1, J2,
  409.     1                   A1, A2, PA, MININD, MAXIND, MODE)
  410.      INTEGER IDIM, JDIM, I1, I2, J1, J2, MININD, MAXIND, MODE
  411.      REAL    A(IDIM,JDIM), A1, A2, PA(6)
  412.  
  413.  This is a support routine for PGIMAG.
  414.  
  415.  Arguments:
  416.   A      (input)  : the array to be plotted.
  417.   IDIM   (input)  : the first dimension of array A.
  418.   JDIM   (input)  : the second dimension of array A.
  419.   I1, I2 (input)  : the inclusive range of the first index
  420.                     (I) to be plotted.
  421.   J1, J2 (input)  : the inclusive range of the second
  422.                     index (J) to be plotted.
  423.   A1     (input)  : the array value which is to appear in color
  424.                     index MININD.
  425.   A2     (input)  : the array value which is to appear in color
  426.                     index MAXIND.
  427.   PA     (input)  : transformation matrix between array grid and
  428.                     device coordinates.
  429.   MININD (input)  : minimum color index to use.
  430.   MAXIND (input)  : maximum color index to use.
  431.   MODE   (input)  : =0 for linear, =1 for logarithmic, =2 for
  432.                     square-root mapping of array values to color
  433.                     indices.
  434.  
  435. %GRIMG1
  436.  image of a 2D data array (image-primitive devices)
  437.      SUBROUTINE GRIMG1 (A, IDIM, JDIM, I1, I2, J1, J2,
  438.     1                   A1, A2, PA, MININD, MAXIND, MODE)
  439.      INTEGER IDIM, JDIM, I1, I2, J1, J2, MININD, MAXIND, MODE
  440.      REAL    A(IDIM,JDIM), A1, A2, PA(6)
  441.  
  442.  (This routine is called by GRIMG0.)
  443.  
  444. %GRIMG2
  445.  image of a 2D data array (pixel-primitive devices)
  446.      SUBROUTINE GRIMG2 (A, IDIM, JDIM, I1, I2, J1, J2,
  447.     1                   A1, A2, PA, MININD, MAXIND, MODE)
  448.      INTEGER IDIM, JDIM, I1, I2, J1, J2, MININD, MAXIND, MODE
  449.      REAL    A(IDIM,JDIM)
  450.      REAL    A1, A2
  451.      REAL    PA(6)
  452.  
  453.  (This routine is called by GRIMG0.)
  454.  
  455. %GRIMG3
  456.  gray-scale map of a 2D data array, using dither
  457.      SUBROUTINE GRIMG3 (A, IDIM, JDIM, I1, I2, J1, J2,
  458.     1                   BLACK, WHITE, PA, MODE)
  459.      INTEGER IDIM, JDIM, I1, I2, J1, J2, MODE
  460.      REAL    A(IDIM,JDIM)
  461.      REAL    BLACK, WHITE
  462.      REAL    PA(6)
  463.  
  464. %GRINIT
  465.  initialize GRPCKG
  466.      SUBROUTINE GRINIT
  467.  
  468.  Initialize GRPCKG and read font file. Called by GROPEN, but may be
  469.  called explicitly if needed.
  470.  
  471. %GRINQLI
  472.  *obsolete routine*
  473.      SUBROUTINE GRINQLI (INTEN)
  474.  
  475.  GRPCKG: obtain the line intensity of the current graphics device.
  476.  Obsolete routine.
  477.  Argument:
  478.  
  479.  INTEN (integer, output): always returns 1.
  480.  
  481. %GRINQPEN
  482.  *obsolete routine*
  483.      SUBROUTINE GRINQPEN (IP)
  484.  
  485.  GRPCKG: obtain the pen number of the current graphics device.
  486.  Obsolete routine.
  487.  Argument:
  488.  
  489.  IP (integer, output): always receives 1.
  490.  
  491. %GRITOC
  492.  convert integer to character string
  493.      INTEGER FUNCTION GRITOC(INT, STR)
  494.      INTEGER INT
  495.      CHARACTER*(*) STR
  496.  
  497.  Convert integer INT into (decimal) character string in STR.
  498.  
  499. %GRLDEV
  500.  list supported device types
  501.      SUBROUTINE GRLDEV
  502.  
  503.  Support routine for PGLDEV.
  504.  
  505.  Arguments: none
  506.  
  507. %GRLEN
  508.  inquire plotted length of character string
  509.      SUBROUTINE GRLEN (STRING, D)
  510.  
  511.  GRPCKG: length of text string (absolute units)
  512.  
  513. %GRLIN0
  514.  draw a line
  515.      SUBROUTINE GRLIN0 (XP,YP)
  516.  
  517.  GRPCKG (internal routine): draw a line from the current position to a
  518.  specified position, which becomes the new current position. This
  519.  routine takes care of clipping at the viewport boundary, dashed and
  520.  thick lines.
  521.  
  522.  Arguments:
  523.  
  524.  XP, YP (input, real): absolute device coordinates of the end-point of
  525.        the line.
  526.  
  527. %GRLIN1
  528.  draw a dashed line
  529.      SUBROUTINE GRLIN1 (X0,Y0,X1,Y1,RESET)
  530.  
  531.  GRPCKG : dashed line. Generate a visible dashed line between points
  532.  (X0,Y0) and (X1,Y1) according to the dash pattern stored in common.
  533.  If RESET = .TRUE., the pattern will start from the beginning.
  534.  Otherwise, it will continue from its last position.
  535.      DASHED LINE PATTERN ARRAY CONTAINING LENGTHS OF
  536.           MARKS AND SPACES IN UNIT CUBE: GRPATN(*)
  537.      OFFSET IN CURRENT PATTERN SEGMENT: GRPOFF
  538.      CURRENT PATTERN SEGMENT NUMBER: GRIPAT
  539.      NUMBER OF PATTERN SEGMENTS: 8
  540.  
  541. %GRLIN2
  542.  draw a normal line
  543.      SUBROUTINE GRLIN2 (X0,Y0,X1,Y1)
  544.  
  545.  GRPCKG : plot a visible line segment in absolute coords from
  546.  (X0,Y0) to (X1,Y1).  The endpoints of the line segment are rounded
  547.  to the nearest integer and passed to the appropriate device-specific
  548.  routine. It is assumed that the entire line-segment lies within the
  549.  view surface, and that the physical device coordinates are
  550.  non-negative.
  551.  
  552. %GRLIN3
  553.  draw a thick line (multiple strokes)
  554.      SUBROUTINE GRLIN3 (X0,Y0,X1,Y1)
  555.  
  556.  GRPCKG: draw a heavy line from (X0,Y0) to (X1,Y1) by making multiple
  557.  strokes.  In order to simulate a thick pen, the line drawn has
  558.  circular, rather than square, end points.  If this is not done,
  559.  thick letters and other figures have an abnormal and unpleasant
  560.  appearance.
  561.  
  562.  Vocabulary:
  563.  
  564.  LINEWT: the number of strokes required to draw the line; if
  565.        this is odd, one stroke will lie along the requested vector.
  566.        The nominal line thickness is (LINEWT-1)*0.005 in.
  567.  RSQURD: the square of the semi-line thickness.
  568.  (DX,DY): the vector length of the line.
  569.  (VX,VY): a vector of length 1 pixel in the direction of the line.
  570.  (VY,-VX): a vector of length 1 pixel perpendicular to (VX,VY).
  571.  OFF: the offset parallel to (VY,-VX) of the K'th stroke.
  572.  (VXK,VYK): the vector increment of the K'th stroke to allow for the
  573.        semi-circular terminal on the line.
  574.  (PXK,PYK): the vector offset of the K'th stroke perpendicular to the
  575.        line vector.
  576.  
  577. %GRLINA
  578.  draw a line (absolute, world coordinates)
  579.      SUBROUTINE GRLINA (X,Y)
  580.  
  581.  GRPCKG: draw line from current position to a specified position.
  582.  
  583.  Arguments:
  584.  
  585.  X, Y (real, input): world coordinates of the end-point of the line.
  586.  
  587. %GRLINR
  588.  draw a line (relative, world coordinates)
  589.      SUBROUTINE GRLINR (DX,DY)
  590.  
  591.  GRPCKG: draw a line from the current position by a specified
  592.  relative displacement.
  593.  
  594.  Arguments:
  595.  
  596.  DX, DY (real, input): the displacement in world coordinates: the pen
  597.        position is incremented by DX in x and DY in y.
  598.  
  599. %GRMARK
  600.  mark points with specified symbol
  601.      SUBROUTINE GRMARK (IDENT,CENTER,SYMBOL,ABSXY,POINTS,X,Y)
  602.  
  603.  GRPCKG: mark a sequence of points with a specified symbol. The
  604.  plot is windowed in the current subarea.
  605.  
  606.  Arguments:
  607.  
  608.  IDENT (integer, input): plot identifier from GROPEN.
  609.  CENTER (input, logical): if .TRUE. the symbol is centered on the point,
  610.       otherwise the bottom left corner is placed at the point.
  611.  SYMBOL (byte or integer, input): code number of symbol in range 0-127
  612.       (ASCII character or special symbol); if SYMBOL is outside this
  613.       range, nothing is plotted.
  614.  ABSXY (logical, input): if .TRUE. (X,Y) are absolute (device)
  615.       coordinates; otherwise they are world coordinates and the
  616.       scaling transformation is applied.
  617.  POINTS (integer, input): the number of points; if POINTS is less than
  618.       or equal to 0, nothing is plotted.
  619.  X,Y (real arrays, dimension at least POINTS, input): the coordinate
  620.       pairs; if POINTS=1, these may be scalars instead of arrays.
  621.  
  622.  (9-Mar-1983)
  623.  
  624. %GRMKER
  625.  draw graph markers
  626.      SUBROUTINE GRMKER (SYMBOL,ABSXY,N,X,Y)
  627.  
  628.  GRPCKG: Draw a graph marker at a set of points in the current
  629.  window. Line attributes (color, intensity, and  thickness)
  630.  apply to markers, but line-style is ignored. After the call to
  631.  GRMKER, the current pen position will be the center of the last
  632.  marker plotted.
  633.  
  634.  Arguments:
  635.  
  636.  SYMBOL (input, integer): the marker number to be drawn. Numbers
  637.        0-31 are special marker symbols; numbers 32-127 are the
  638.        corresponding ASCII characters (in the current font). If the
  639.        number is >127, it is taken to be a Hershey symbol number.
  640.        If -ve, a regular polygon is drawn.
  641.  ABSXY (input, logical): if .TRUE., the input corrdinates (X,Y) are
  642.        taken to be absolute device coordinates; if .FALSE., they are
  643.        taken to be world coordinates.
  644.  N (input, integer): the number of points to be plotted.
  645.  X, Y (input, real arrays, dimensioned at least N): the (X,Y)
  646.        coordinates of the points to be plotted.
  647.  
  648. %GRMOVA
  649.  move pen (absolute, world coordinates)
  650.      SUBROUTINE GRMOVA (X,Y)
  651.  
  652.  GRPCKG: move the pen to a specified location.
  653.  
  654.  Arguments:
  655.  
  656.  X, Y (real, input): world coordinates of the new pen position.
  657.  
  658. %GRMOVR
  659.  move pen (relative, world coordinates)
  660.      SUBROUTINE GRMOVR (DX,DY)
  661.  
  662.  GRPCKG: move the pen through a specified displacement.
  663.  
  664.  Arguments:
  665.  
  666.  DX, DY (real, input): the displacement in world coordinates: the pen
  667.        position is incremented by DX in x and DY in y.
  668.  
  669. %GRMSG
  670.  issue message to user
  671.      SUBROUTINE GRMSG (TEXT)
  672.      CHARACTER*(*) TEXT
  673.  
  674.  Display a message on standard output.
  675.  
  676.  Argument:
  677.   TEXT (input): text of message to be printed (the string
  678.       may not be blank).
  679.  
  680. %GROPEN
  681.  open device for graphics
  682.      INTEGER FUNCTION GROPEN (TYPE,DUMMY,FILE,IDENT)
  683.      INTEGER   TYPE, DUMMY, IDENT
  684.      CHARACTER*(*) FILE
  685.  
  686.  GRPCKG: assign a device and prepare for plotting.  GROPEN must be
  687.  called before all other calls to GRPCKG routines.
  688.  
  689.  Returns:
  690.  
  691.  GROPEN (output, integer): 1 => success, any other value
  692.        indicates a failure (usually the value returned will
  693.        be a VMS error code). In the event of an error, a
  694.        message will be sent to the standard error unit.
  695.  
  696.  Arguments:
  697.  
  698.  TYPE (input, integer): default device type (integer code).
  699.  DUMMY (input, integer): not used at present.
  700.  FILE (input, character): plot specifier, of form 'device/type'.
  701.  IDENT (output, integer): plot identifier to be used in later
  702.        calls to GRPCKG.
  703.  
  704.   1-Jun-1984 - [TJP].
  705.   2-Jul-1984 - change to call GRSLCT [TJP].
  706.  13-Jul-1984 - add device initialization [TJP].
  707.  23-Jul-1984 - add /APPEND qualifier.
  708.  19-Oct-1984 - add VV device [TJP].
  709.  26-Dec-1984 - obtain default file name from common [TJP].
  710.  29-Jan-1985 - add HP2648 device [KS/TJP].
  711.   5-Aug-1986 - add GREXEC support [AFT].
  712.  12-Oct-1986 - fix bug causing GREXEC to erase screen [AFT].
  713.   3-Jun-1987 - remove declaration of exit handler [TJP].
  714.  15-Dec-1988 - standardize [TJP].
  715.  25-Jun-1989 - remove code that removes spaces from the device name
  716.                [TJP].
  717.  26-Nov-1990 - [TJP].
  718.   5-Jan-1993 - [TJP].
  719.   1-Sep-1994 - store device capabilities in common for later use [TJP].
  720.  17-Apr-1995 - zero-length string fix [TJP].
  721.   6-Jun-1995 - explicitly initialize GRSTAT [TJP].
  722.  29-Apr-1996 - moved initialization into GRINIT [TJP].
  723.  
  724. %GRPAGE
  725.  end picture
  726.      SUBROUTINE GRPAGE
  727.  
  728.  GRPCKG: Advance the plotting area to a new page. For video devices,
  729.  this amounts to erasing the screen; for hardcopy devices, the plot
  730.  buffer is written to the output file followed by a form-feed to
  731.  advance the paper to the start of the next page.
  732.  
  733.  Arguments: none.
  734.  
  735. %GRPARS
  736.  parse device specification string
  737.      INTEGER FUNCTION GRPARS (SPEC,DEV,TYPE,APPEND)
  738.      CHARACTER*(*) SPEC, DEV
  739.      INTEGER  TYPE
  740.      LOGICAL  APPEND
  741.  
  742.  GRPCKG: decode a device-specification; called by GROPEN.
  743.  
  744.  Returns:
  745.   GRPARS (output): 1 if the device-specification is
  746.        acceptable; any other value indicates an error.
  747.  
  748.  Arguments:
  749.   SPEC (input): the device specification.
  750.   DEV  (output):  device name or file spec.
  751.   TYPE (output): device type (integer code); 0 if no device
  752.        type is specified.
  753.   APPEND (output): .TRUE. if /APPEND specified, .FALSE. otherwise.
  754.  
  755. %GRPIXL
  756.  solid-fill multiple rectangular areas
  757.      SUBROUTINE GRPIXL (IA, IDIM, JDIM, I1, I2, J1, J2,
  758.     1                   X1, X2, Y1, Y2)
  759.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  760.      INTEGER IA(IDIM,JDIM)
  761.      REAL    X1, X2, Y1, Y2
  762.  
  763.  Determine the size of each rectangular element. If it is equal
  764.  to the device pen width and the device supports pixel primitives,
  765.  use pixel primitives. Otherwise, if the size is smaller than the
  766.  device pen width emulate pixel output by plotting points. If the
  767.  size is larger than the device pen width, emulate by outputting
  768.  solid-filled rectangles.
  769.  
  770.  Arguments:
  771.   IA     (input)  : the array to be plotted.
  772.   IDIM   (input)  : the first dimension of array A.
  773.   JDIM   (input)  : the second dimension of array A.
  774.   I1, I2 (input)  : the inclusive range of the first index
  775.                     (I) to be plotted.
  776.   J1, J2 (input)  : the inclusive range of the second
  777.                     index (J) to be plotted.
  778.   X1, Y1 (input)  : world coordinates of one corner of the output
  779.                     region
  780.   X2, Y2 (input)  : world coordinates of the opposite corner of the
  781.                     output region
  782.  
  783. %GRPOCL
  784.  polygon clip
  785.      SUBROUTINE GRPOCL (N,PX,PY, EDGE, VAL, MAXOUT, NOUT, QX, QY)
  786.      INTEGER N, NOUT, EDGE, MAXOUT
  787.      REAL    PX(*), PY(*), QX(*), QY(*)
  788.      REAL    VAL
  789.  
  790.  Clip a polygon against a rectangle: Sutherland-Hodgman algorithm.
  791.  this routine must be called four times to clip against each of the
  792.  edges of the rectangle in turn.
  793.  
  794.  Arguments:
  795.  
  796.  N (input, integer): the number of vertices of the polygon (at least
  797.        3).
  798.  PX, PY (input, real arrays, dimension at least N): world coordinates
  799.        of the N vertices of the input polygon.
  800.  EDGE (input, integer):
  801.      1: clip against left edge,   X > XMIN=VAL
  802.      2: clip against right edge,  X < XMAX=VAL
  803.      3: clip against bottom edge, Y > YMIN=VAL
  804.      4: clip against top edge,    Y < YMIN=VAL
  805.  VAL  (input, real): coordinate value of current edge.
  806.  MAXOUT (input, integer): maximum number of vertices allowed in
  807.      output polygon (dimension of QX, QY).
  808.  NOUT (output, integer): the number of vertices in the clipped polygon.
  809.  QX, QY (output, real arrays, dimension at least MAXOUT): world
  810.        coordinates of the NOUT vertices of the output polygon.
  811.  
  812. %GRPROM
  813.  prompt user before clearing screen
  814.      SUBROUTINE GRPROM
  815.  
  816.  If the program is running under control of a terminal, display
  817.  message and wait for the user to type <CR> before proceeding.
  818.  
  819.  Arguments:
  820.   none
  821.  
  822. %GRPXPO
  823.  Emulate pixel operations using points
  824.      SUBROUTINE GRPXPO (IA, IDIM, JDIM, I1, I2, J1, J2,
  825.     1                   X1, X2, Y1, Y2)
  826.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  827.      INTEGER IA(IDIM,JDIM)
  828.      REAL    X1, X2, Y1, Y2
  829.  
  830.  Arguments:
  831.   IA     (input)  : the array to be plotted.
  832.   IDIM   (input)  : the first dimension of array A.
  833.   JDIM   (input)  : the second dimension of array A.
  834.   I1, I2 (input)  : the inclusive range of the first index
  835.                     (I) to be plotted.
  836.   J1, J2 (input)  : the inclusive range of the second
  837.                     index (J) to be plotted.
  838.   X1, X2 (input)  : the horizontal range of the output region
  839.   Y1, Y2 (input)  : the vertical range of the output region
  840.  
  841. %GRPXPS
  842.  pixel dump for color or grey PostScript.
  843.      SUBROUTINE GRPXPS (IA, IDIM, JDIM, I1, I2, J1, J2,
  844.     :                   XMIN, XMAX, YMIN, YMAX)
  845.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  846.      INTEGER IA(IDIM,JDIM)
  847.      REAL XMIN, XMAX, YMIN, YMAX
  848.  
  849.  This routine is called by GRPIXL.
  850.  
  851. %GRPXPX
  852.  Perform pixel operations using pixel primitive
  853.      SUBROUTINE GRPXPX (IA, IDIM, JDIM, I1, I2, J1, J2, X, Y)
  854.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  855.      INTEGER IA(IDIM,JDIM)
  856.      REAL    X, Y
  857.  
  858.  Arguments:
  859.   IA     (input)  : the array to be plotted.
  860.   IDIM   (input)  : the first dimension of array A.
  861.   JDIM   (input)  : the second dimension of array A.
  862.   I1, I2 (input)  : the inclusive range of the first index
  863.                     (I) to be plotted.
  864.   J1, J2 (input)  : the inclusive range of the second
  865.                     index (J) to be plotted.
  866.   X, Y   (input)  : the lower left corner of the output region
  867.                     (device coordinates)
  868.  
  869. %GRPXRE
  870.  Emulate pixel operations using rectangles
  871.      SUBROUTINE GRPXRE (IA, IDIM, JDIM, I1, I2, J1, J2,
  872.     1                   X1, X2, Y1, Y2)
  873.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  874.      INTEGER IA(IDIM,JDIM)
  875.      REAL    X1, X2, Y1, Y2
  876.  
  877.  Arguments:
  878.   IA     (input)  : the array to be plotted.
  879.   IDIM   (input)  : the first dimension of array A.
  880.   JDIM   (input)  : the second dimension of array A.
  881.   I1, I2 (input)  : the inclusive range of the first index
  882.                     (I) to be plotted.
  883.   J1, J2 (input)  : the inclusive range of the second
  884.                     index (J) to be plotted.
  885.   X1, X2 (input)  : the horizontal range of the output region
  886.   Y1, Y2 (input)  : the vertical range of the output region
  887.  
  888. %GRQCAP
  889.  inquire device capabilities
  890.      SUBROUTINE GRQCAP (STRING)
  891.      CHARACTER*(*) STRING
  892.  
  893.  GRPCKG: obtain the "device capabilities" string from the device
  894.  driver for the current device.
  895.  
  896.  Arguments:
  897.  
  898.  STRING (output, CHARACTER*(*)): receives the device capabilities
  899.        string.
  900.  
  901. %GRQCI
  902.  inquire current color index
  903.      SUBROUTINE GRQCI (C)
  904.  
  905.  GRPCKG: obtain the color index of the current graphics device.
  906.  
  907.  Argument:
  908.  
  909.  C (integer, output): receives the current color index (0-255).
  910.  
  911. %GRQCOL
  912.  inquire color capability
  913.      SUBROUTINE GRQCOL (CI1, CI2)
  914.      INTEGER  CI1, CI2
  915.  
  916.  Query the range of color indices available on the current device.
  917.  
  918.  Argument:
  919.   CI1    (output) : the minimum available color index. This will be
  920.                     either 0 if the device can write in the
  921.                     background color, or 1 if not.
  922.   CI2    (output) : the maximum available color index. This will be
  923.                     1 if the device has no color capability, or a
  924.                     larger number (e.g., 3, 7, 15, 255).
  925.  
  926. %GRQCR
  927.  inquire color representation
  928.      SUBROUTINE GRQCR (CI, CR, CG, CB)
  929.      INTEGER  CI
  930.      REAL     CR, CG, CB
  931.  
  932.  Return the color representation (red, green, blue intensities)
  933.  currently associated with the specified color index. This may be
  934.  different from that requested on some devices.
  935.  
  936.  Arguments:
  937.  
  938.  CI (integer, input): color index.
  939.  CR, CG, CB (real, output): red, green, and blue intensities,
  940.        in range 0.0 to 1.0.
  941.  
  942. %GRQDEV
  943.  inquire current device
  944.      SUBROUTINE GRQDEV (DEVICE, L)
  945.      CHARACTER*(*) DEVICE
  946.      INTEGER L
  947.  
  948.  Obtain the name of the current graphics device or file.
  949.  
  950.  Argument:
  951.   DEVICE (output): receives the device name of the
  952.        currently active device.
  953.   L (output): number of characters in DEVICE, excluding trailing
  954.        blanks.
  955.  
  956. %GRQDT
  957.  inquire current device and type
  958.      SUBROUTINE GRQDT (DEVICE)
  959.  
  960.  GRPCKG: obtain the name and type of the current graphics device.
  961.  
  962.  Argument:
  963.  
  964.  DEVICE (output, character): receives the device name and type of the
  965.        currently active device in the form 'device/type'; this is a
  966.        valid string for input to GROPEN.
  967.  
  968. %GRQFNT
  969.  inquire current font
  970.      SUBROUTINE GRQFNT (IF)
  971.  
  972.  GRPCKG: obtain the font number of the current graphics device.
  973.  
  974.  Argument:
  975.  
  976.  IF (integer, output): receives the current font number (1-3).
  977.  
  978. %GRQLS
  979.  inquire current line-style
  980.      SUBROUTINE GRQLS (ISTYLE)
  981.      INTEGER  ISTYLE
  982.  
  983.  GRPCKG: obtain the line-style of the current graphics device.
  984.  
  985.  Argument:
  986.   ISTYLE (output): receives the current line-style code.
  987.  
  988. %GRQLW
  989.  inquire current line width
  990.      SUBROUTINE GRQLW (IWIDTH)
  991.      INTEGER  IWIDTH
  992.  
  993.  GRPCKG: obtain the line-width of the current graphics device.
  994.  
  995.  Argument:
  996.   IWIDTH (output): receives the current line-width.
  997.  
  998. %GRQPOS
  999.  return current pen position (absolute, world coordinates)
  1000.      SUBROUTINE GRQPOS(X,Y)
  1001.  
  1002.  GRQPOS: returns the current pen position in absolute, world
  1003.  coordinates.
  1004.  
  1005.  Arguments:
  1006.  
  1007.  X, Y (real, output): world coordinates of the pen position.
  1008.  
  1009. %GRQTXT
  1010.  get text bounding box
  1011.      SUBROUTINE GRQTXT (ORIENT,X0,Y0,STRING, XBOX, YBOX)
  1012.  
  1013.  GRPCKG: get the bounding box of a string drawn by GRTEXT.
  1014.  
  1015. %GRQTYP
  1016.  inquire current device type
  1017.      SUBROUTINE GRQTYP (TYPE,INTER)
  1018.      CHARACTER*(*) TYPE
  1019.      LOGICAL INTER
  1020.  
  1021.  GRPCKG: obtain the device type of the currently selected graphics
  1022.  device, and determine whether or not it is an interactive device.
  1023.  
  1024.  Arguments:
  1025.  
  1026.  TYPE (output, CHARACTER*(*)): receives the device type, as a
  1027.        character string, eg 'PRINTRONIX', 'TRILOG', 'VERSATEC',
  1028.        'TEK4010', 'TEK4014', 'GRINNELL', or 'VT125'.  The character
  1029.        string should have a length of at least 8 to ensure that the
  1030.        type is unique.
  1031.  INTER (output, LOGICAL): receives the value .TRUE. if the device is
  1032.        interactive, .FALSE. otherwise.
  1033.  
  1034. %GRQUIT
  1035.  report a fatal error and abort execution
  1036.      SUBROUTINE GRQUIT (TEXT)
  1037.      CHARACTER*(*) TEXT
  1038.  
  1039.  Report a fatal error (via GRWARN) and exit program.
  1040.  This routine should be called in the event of an unrecoverable
  1041.  PGPLOT error.
  1042.  
  1043.  Argument:
  1044.   TEXT (input): text of message to be sent to GRWARN.
  1045.  
  1046. %GRREC0
  1047.  fill a rectangle (device coordinates)
  1048.      SUBROUTINE GRREC0 (X0,Y0,X1,Y1)
  1049.      REAL X0, Y0, X1, Y1
  1050.  
  1051.  GRPCKG: Fill a rectangle with solid color.  The rectangle
  1052.  is defined by the (x,y) device coordinates of its lower left and
  1053.  upper right corners; the edges are parallel to the coordinate axes.
  1054.  X0 is guaranteed to be <= X1 and Y0 <= Y1. The rectangle possible
  1055.  extends beyond the clipping boundaries
  1056.  
  1057.  Arguments:
  1058.  
  1059.  X0, Y0 (input, real): device coordinates of one corner of the
  1060.        rectangle.
  1061.  X1, Y1 (input, real): device coordinates of the opposite corner of
  1062.        the rectangle.
  1063.  
  1064. %GRRECT
  1065.  fill a rectangle
  1066.      SUBROUTINE GRRECT (X0,Y0,X1,Y1)
  1067.      REAL X0, Y0, X1, Y1
  1068.  
  1069.  GRPCKG: Fill a rectangle with solid color.  The rectangle
  1070.  is defined by the (x,y) world coordinates of its lower left and upper
  1071.  right corners; the edges are parallel to the coordinate axes.
  1072.  
  1073.  Arguments:
  1074.  
  1075.  X0, Y0 (input, real): world coordinates of one corner of the
  1076.        rectangle.
  1077.  X1, Y1 (input, real): world coordinates of the opposite corner of the
  1078.        rectangle.
  1079.  
  1080. %GRSCI
  1081.  set color index
  1082.      SUBROUTINE GRSCI (IC)
  1083.  
  1084.  GRPCKG: Set the color index for subsequent plotting. Calls to GRSCI
  1085.  are ignored for monochrome devices. The default color index is 1,
  1086.  usually white on a black background for video displays or black on a
  1087.  white background for printer plots. The color index is an integer in
  1088.  the range 0 to a device-dependent maximum. Color index 0 corresponds
  1089.  to the background color; lines may be "erased" by overwriting them
  1090.  with color index 0.
  1091.  
  1092.  Color indices 0-7 are predefined as follows: 0 = black (background
  1093.  color), 1 = white (default), 2 = red, 3 = green, 4 = blue, 5 = cyan
  1094.  (blue + green), 6 = magenta (red + blue), 7 = yellow (red + green).
  1095.  The assignment of colors to color indices can be changed with
  1096.  subroutine GRSCR (set color representation).
  1097.  
  1098.  Argument:
  1099.  
  1100.  IC (integer, input): the color index to be used for subsequent
  1101.        plotting on the current device (in range 0-255). If the
  1102.        index exceeds the device-dependent maximum, the result is
  1103.        device-dependent.
  1104.  
  1105. %GRSCR
  1106.  set color representation
  1107.      SUBROUTINE GRSCR (CI, CR, CG, CB)
  1108.      INTEGER  CI
  1109.      REAL     CR, CG, CB
  1110.  
  1111.  GRPCKG: SET COLOUR REPRESENTATION -- define the colour to be
  1112.  associated with a colour index.  Ignored for devices which do not
  1113.  support variable colour or intensity.  On monochrome output
  1114.  devices (e.g. VT125 terminals with monochrome monitors), the
  1115.  monochrome intensity is computed from the specified Red, Green, Blue
  1116.  intensities as 0.30*R + 0.59*G + 0.11*B, as in US color television
  1117.  systems, NTSC encoding.  Note that most devices do not have an
  1118.  infinite range of colours or monochrome intensities available;
  1119.  the nearest available colour is used.
  1120.  
  1121.  Arguments:
  1122.  
  1123.  CI (integer, input): colour index. If the colour index is outside the
  1124.        range available on the device, the call is ignored. Colour
  1125.        index 0 applies to the background colour.
  1126.  CR, CG, CB (real, input): red, green, and blue intensities,
  1127.        in range 0.0 to 1.0.
  1128.  
  1129. %GRSETC
  1130.  set character size
  1131.      SUBROUTINE GRSETC (IDENT,XSIZE)
  1132.  
  1133.  GRPCKG : change the character size (user-callable routine).
  1134.  
  1135.  Input:   IDENT : plot identifier
  1136.           XSIZE : the new character width. The character height
  1137.                   and spacing will be scaled by the same factor.
  1138.                   If XSIZE is negative or zero, the character size
  1139.                   will be set to the default size.
  1140.  
  1141. %GRSETLI
  1142.  *obsolete routine*
  1143.      SUBROUTINE GRSETLI (IN)
  1144.  
  1145.  GRPCKG: Set the line intensity for subsequent plotting on the current
  1146.  device. *** OBSOLETE ROUTINE *** Intensity is now set with GRSCI
  1147.  and GRSCR. For compatibility, GRSETLI now sets color zero if its
  1148.  argument is 0, and resets the previous color if its argument is
  1149.  non-zero.
  1150.  
  1151.  Argument:
  1152.  
  1153.  IN (integer, input): the intensity to be used for subsequent
  1154.        plotting on the current device (in range 0-3).
  1155.  
  1156. %GRSETPEN
  1157.  *obsolete routine*
  1158.      SUBROUTINE GRSETPEN
  1159.  
  1160.  GRPCKG: Set the pen number for subsequent plotting.  Obsolete
  1161.  routine: ignored.
  1162.  
  1163. %GRSETS
  1164.  change size of view surface
  1165.      SUBROUTINE GRSETS (IDENT,XSIZE,YSIZE)
  1166.  
  1167.  GRPCKG : change size of plotting area. The requested dimensions
  1168.  will be reduced to the absolute maximum of the plot device if
  1169.  necessary.
  1170.  
  1171.  Arguments:
  1172.  
  1173.  IDENT (input, integer): plot identifier from GROPEN.
  1174.  XSIZE (input, real): new x dimension of plot area (absolute
  1175.                units); if less than zero, the default dimension
  1176.                will be used.
  1177.  YSIZE (input, real): new y dimension of plot area (absolute
  1178.                units); if less than zero, the default dimension
  1179.                will be used.
  1180.  
  1181. %GRSFNT
  1182.  set text font
  1183.      SUBROUTINE GRSFNT (IF)
  1184.      INTEGER IF
  1185.  
  1186.  GRPCKG: Set the font for subsequent text plotting.
  1187.  The default font is 1 ("Normal" font); others available are 2
  1188.  ("Roman"), 3 ("Italic"), and 4 ("Script").
  1189.  
  1190.  Argument:
  1191.   IF (input): the font number to be used for subsequent
  1192.        text plotting on the current device (in range 1-4).
  1193.  
  1194. %GRSIZE
  1195.  inquire device size and resolution
  1196.      SUBROUTINE GRSIZE (IDENT,XSZDEF,YSZDEF,XSZMAX,YSZMAX,
  1197.     1                   XPERIN,YPERIN)
  1198.  
  1199.  GRPCKG : obtain device parameters (user-callable routine).
  1200.  
  1201. %GRSKPB
  1202.  skip blanks in character string
  1203.      SUBROUTINE GRSKPB (S, I)
  1204.      CHARACTER*(*) S
  1205.      INTEGER I
  1206.  
  1207.  GRSKPB: increment I so that it points to the next non-blank
  1208.  character in string S.  'Blank' characters are space and tab (ASCII
  1209.  character value 9).
  1210.  
  1211.  Arguments:
  1212.   S      (input)  : character string to be parsed.
  1213.   I      (in/out) : on input, I is the index of the first character
  1214.                     in S to be examined; on output, either it points
  1215.                     to the next non-blank character, or it is equal
  1216.                     to LEN(S)+1 (if all the rest of the string is
  1217.                     blank).
  1218.  
  1219. %GRSLCT
  1220.  select active output device
  1221.      SUBROUTINE GRSLCT (IDENT)
  1222.  
  1223.  GRPCKG: Check that IDENT is a valid plot identifier, and select the
  1224.  corresponding plot as the current plot. All subsequent plotting will
  1225.  be directed to this device until the assignment is changed by another
  1226.  call to GRSLCT.
  1227.  
  1228.  Argument:
  1229.  
  1230.  IDENT (input, integer): the identifier of the plot to be selected, as
  1231.        returned by GROPEN.
  1232.  
  1233. %GRSLS
  1234.  set line style
  1235.      SUBROUTINE GRSLS (IS)
  1236.      INTEGER IS
  1237.  
  1238.  GRPCKG: Set the line style for subsequent plotting on the current
  1239.  device. The different line styles are generated in hardware on
  1240.  some devices and by GRPCKG software for the other devices. Five
  1241.  different line styles are available, with the following codes:
  1242.  1 (full line), 2 (dashed), 3 (dot-dash-dot-dash), 4 (dotted),
  1243.  5 (dash-dot-dot-dot). The default is 1 (normal full line). Line
  1244.  style is ignored when drawing characters, which are always drawn with
  1245.  a full line.
  1246.  
  1247.  Argument:
  1248.  
  1249.  IS (input, integer): the line-style code for subsequent plotting on
  1250.        the current device (in range 1-5).
  1251.  
  1252. %GRSLW
  1253.  set line width
  1254.      SUBROUTINE GRSLW (IW)
  1255.      INTEGER IW
  1256.  
  1257.  GRPCKG: Set the line width for subsequent plotting on the current
  1258.  device. If the hardware does not support thick lines, they are
  1259.  simulated by tracing each line with multiple strokes offset in the
  1260.  direction perpendicular to the line. The line width is specified by
  1261.  the number of strokes to be used, which must be in the range 1-201.
  1262.  The actual line width obtained depends on the device resolution.
  1263.  If the hardware does support thick lines, the width of the line
  1264.  is approximately 0.005 inches times the value of argument IW.
  1265.  
  1266.  Argument:
  1267.  
  1268.  IW (integer, input): the number of strokes to be used for subsequent
  1269.        plotting on the current device (in range 1-201).
  1270.  
  1271. %GRSYDS
  1272.  decode character string into list of symbol numbers
  1273.      SUBROUTINE GRSYDS (SYMBOL, NSYMBS, TEXT, FONT)
  1274.      INTEGER SYMBOL(*), NSYMBS, FONT
  1275.      CHARACTER*(*) TEXT
  1276.  
  1277.  Given a character string, this routine returns a list of symbol
  1278.  numbers to be used to plot it. It is responsible for interpreting
  1279.  all escape sequences.  Negative `symbol numbers' are inserted in the
  1280.  list to represent pen movement. The following escape sequences are
  1281.  defined (the letter following the \ may be either upper or lower
  1282.  case):
  1283.  
  1284.  \u       :      up one level (returns -1)
  1285.  \d       :      down one level (returns -2)
  1286.  \b       :      backspace (returns -3)
  1287.  \A       :      (upper case only) Angstrom symbol, roman font
  1288.  \x       :      multiplication sign
  1289.  \.       :      centered dot
  1290.  \\       :      \, returns the code for backslash
  1291.  \gx      :      greek letter corresponding to roman letter x
  1292.  \fn      :      switch to Normal font
  1293.  \fr      :      switch to Roman font
  1294.  \fi      :      switch to Italic font
  1295.  \fs      :      switch to Script font
  1296.  \mn or \mnn :   graph marker number n or nn (1 or 2 digits)
  1297.  \(nnn)   :      Hershey symbol number nnn (any number of digits)
  1298.  
  1299.  Arguments:
  1300.   SYMBOL (output) : receives the list of symbol numers.
  1301.   NSYMBS (output) : receives the actual number of symbols specified
  1302.                     by the string; it is assumed that the dimension of
  1303.                     SYMBOL is big enough (not less than LEN(TEXT)).
  1304.   TEXT   (input)  : the text string to be decoded.
  1305.   FONT   (input)  : the font number (1..4) to be used for decoding the
  1306.                     string (this can be overridden by an escape
  1307.                     sequence within the string).
  1308.  
  1309. %GRSYMK
  1310.  convert character number into symbol number
  1311.      SUBROUTINE GRSYMK (CODE, FONT, SYMBOL)
  1312.      INTEGER CODE, FONT, SYMBOL
  1313.  
  1314.  This routine returns the Hershey symbol number (SYMBOL) corresponding
  1315.  to ASCII code CODE in font FONT.
  1316.  
  1317.  Characters 0-31 are the same in all fonts, and are the standard
  1318.  graph markers. Characters 32-127 are standard representations of
  1319.  the ASCII codes. Characters 128-255 are reserved for the upper
  1320.  half of the ISO Latin-1 character set. Characters 256-303 are
  1321.  used for the greek alphabet.
  1322.  
  1323.  Arguments:
  1324.   CODE   (input)  : the extended ASCII code number.
  1325.   FONT   (input)  : the font to be used 31 (range 1-4).
  1326.   SYMBOL (output) : the number of the symbol to be plotted.
  1327.  
  1328. %GRTERM
  1329.  flush buffer to output device
  1330.      SUBROUTINE GRTERM
  1331.  
  1332.  GRPCKG: flush the buffer associated with the current plot. GRTERM
  1333.  should be called only when it is necessary to make sure that all the
  1334.  graphics created up to this point in the program are visible on the
  1335.  device, e.g., before beginning a dialog with the user. GRTERM has no
  1336.  effect on hardcopy devices.
  1337.  
  1338.  Arguments: none.
  1339.  
  1340. %GRTEXT
  1341.  draw text
  1342.      SUBROUTINE GRTEXT (CENTER,ORIENT,ABSXY,X0,Y0,STRING)
  1343.  
  1344.  GRPCKG: Write a text string using the high-quality character set.
  1345.  The text is NOT windowed in the current viewport, but may extend over
  1346.  the whole view surface.  Line attributes (color, intensity thickness)
  1347.  apply to text, but line-style is ignored.  The current pen position
  1348.  after a call to GRTEXT is undefined.
  1349.  
  1350.  Arguments:
  1351.  
  1352.  STRING (input, character): the character string to be plotted. This
  1353.        may include standard escape-sequences to represent non-ASCII
  1354.        characters and special commands. The number of characters in
  1355.        STRING (i.e., LEN(STRING)) should not exceed 256.
  1356.  
  1357. %GRTOUP
  1358.  convert character string to upper case
  1359.      SUBROUTINE GRTOUP (DST, SRC)
  1360.      CHARACTER*(*) DST, SRC
  1361.  
  1362.  GRPCKG (internal routine): convert character string to upper case.
  1363.  
  1364.  Arguments:
  1365.   DST    (output) : output string (upper case).
  1366.   SRC    (input)  : input string to be converted.
  1367.  
  1368. %GRTRAN
  1369.  define scaling transformation
  1370.      SUBROUTINE GRTRAN (IDENT,XORG,YORG,XSCALE,YSCALE)
  1371.  
  1372.  GRPCKG (internal routine): Define scaling transformation.
  1373.  
  1374.  Arguments:
  1375.  
  1376.  IDENT (input, integer): plot identifier, as returned by GROPEN.
  1377.  XORG, YORG, XSCALE, YSCALE (input, real): parameters of the scaling
  1378.        transformation. This is defined by:
  1379.                XABS = XORG + XWORLD * XSCALE,
  1380.                YABS = YORG + YWORLD * YSCALE,
  1381.        where (XABS, YABS) are the absolute device coordinates
  1382.        corresponding to world coordinates (XWORLD, YWORLD).
  1383.  
  1384. %GRTRN0
  1385.  define scaling transformation
  1386.      SUBROUTINE GRTRN0 (XORG,YORG,XSCALE,YSCALE)
  1387.  
  1388.  GRPCKG (internal routine): Define scaling transformation for current
  1389.  device (equivalent to GRTRAN without device selection).
  1390.  
  1391.  Arguments:
  1392.  
  1393.  XORG, YORG, XSCALE, YSCALE (input, real): parameters of the scaling
  1394.        transformation. This is defined by:
  1395.                XABS = XORG + XWORLD * XSCALE,
  1396.                YABS = YORG + YWORLD * YSCALE,
  1397.        where (XABS, YABS) are the absolute device coordinates
  1398.        corresponding to world coordinates (XWORLD, YWORLD).
  1399.  
  1400. %GRTXY0
  1401.  convert world coordinates to device coordinates
  1402.      SUBROUTINE GRTXY0 (ABSXY,X,Y,XT,YT)
  1403.  
  1404.  GRPCKG (internal routine): Convert scaled position to absolute
  1405.  position.
  1406.  
  1407.  Arguments:
  1408.  
  1409.  ABSXY (input, logical): if FALSE, convert world coordinates to
  1410.        absolute device coordinates; if TRUE, return the input
  1411.        coordinates unchanged.
  1412.  X, Y (input, real): input coordinates (absolute or world, depending
  1413.        on setting of ABSXY).
  1414.  XT, YT (output, real): output absolute device coordinates.
  1415.  
  1416. %GRVCT0
  1417.  draw line segments or dots
  1418.      SUBROUTINE GRVCT0 (MODE,ABSXY,POINTS,X,Y)
  1419.  
  1420.  GRPCKG (internal routine): Draw a line or a set of dots. This
  1421.  is the same as GRVECT, but without device selection. It can be used to
  1422.  draw a single line-segment, a continuous series of line segments, or
  1423.  one or more single dots (pixels).
  1424.  
  1425.  Arguments:
  1426.  
  1427.  MODE (input, integer): if MODE=1, a series of line segments is drawn,
  1428.        starting at the current position, moving to X(1),Y(1), ... and
  1429.        ending at X(POINTS),Y(POINTS).
  1430.        If MODE=2, the first vector is blanked, so the line starts at
  1431.        X(1),Y(1).
  1432.        If MODE=3, a single dot is placed at each coordinate pair, with
  1433.        no connecting lines.
  1434.  ABSXY (input, logical): if TRUE, the coordinates are absolute device
  1435.        coordinates; if FALSE, they are world coordinates and the
  1436.        scaling transformation is applied.
  1437.  POINTS (input, integer): the number of coordinate pairs.
  1438.  X, Y (input, real arrays, dimensioned POINTS or greater): the
  1439.        X and Y coordinates of the points.
  1440.  
  1441. %GRVECT
  1442.  draw line segments or dots
  1443.      SUBROUTINE GRVECT (IDENT,MODE,ABSXY,POINTS,X,Y)
  1444.  
  1445.  GRPCKG: Draw a line or a set of dots. This routine can be used to
  1446.  draw a single line-segment, a continuous series of line segments, or
  1447.  one or more single dots (pixels).
  1448.  
  1449.  Arguments:
  1450.  
  1451.  IDENT (input, integer): the plot identifier, as returned by GROPEN.
  1452.  MODE (input, integer): if MODE=1, a series of line segments is drawn,
  1453.        starting at the current position, moving to X(1),Y(1), ... and
  1454.        ending at X(POINTS),Y(POINTS).
  1455.        If MODE=2, the first vector is blanked, so the line starts at
  1456.        X(1),Y(1).
  1457.        If MODE=3, a single dot is placed at each coordinate pair, with
  1458.        no connecting lines.
  1459.  ABSXY (input, logical): if TRUE, the coordinates are absolute device
  1460.        coordinates; if FALSE, they are world coordinates and the
  1461.        scaling transformation is applied.
  1462.  POINTS (input, integer): the number of coordinate pairs.
  1463.  X, Y (input, real arrays, dimensioned POINTS or greater): the
  1464.        X and Y coordinates of the points.
  1465.  
  1466. %GRWARN
  1467.  issue warning message to user
  1468.      SUBROUTINE GRWARN (TEXT)
  1469.      CHARACTER*(*) TEXT
  1470.  
  1471.  Report a warning message on standard output, with prefix "%PGPLOT, ".
  1472.  
  1473.  Argument:
  1474.   TEXT (input): text of message to be printed (the string
  1475.       may not be blank).
  1476.  
  1477. %GRXHLS
  1478.  convert RGB color to HLS color
  1479.      SUBROUTINE GRXHLS (R,G,B,H,L,S)
  1480.  
  1481.  GRPCKG: Convert a color specified in the RGB color model to one in
  1482.  the HLS model.  This is a support routine: no graphics I/O occurs.
  1483.  The inverse transformation is accomplished with routine GRXRGB.
  1484.  Reference: SIGGRAPH Status Report of the Graphic Standards Planning
  1485.  Committee, Computer Graphics, Vol.13, No.3, Association for
  1486.  Computing Machinery, New York, NY, 1979.
  1487.  
  1488.  Arguments:
  1489.  
  1490.  R,G,B (real, input): red, green, blue color coordinates, each in the
  1491.        range 0.0 to 1.0. Input outside this range causes HLS = (0,1,0)
  1492.        [white] to be returned.
  1493.  H,L,S (real, output): hue (0 to 360), lightness (0 to 1.0), and
  1494.        saturation (0 to 1.0).
  1495.  
  1496. %GRXRGB
  1497.  convert HLS color to RGB color
  1498.      SUBROUTINE GRXRGB (H,L,S,R,G,B)
  1499.  
  1500.  GRPCKG: Convert a color specified in the HLS color model to one in
  1501.  the RGB model.  This is a support routine: no graphics I/O occurs.
  1502.  The inverse transformation is accomplished with routine GRXHLS.
  1503.  Reference: SIGGRAPH Status Report of the Graphic Standards Planning
  1504.  Committee, Computer Graphics, Vol.13, No.3, Association for
  1505.  Computing Machinery, New York, NY, 1979.
  1506.  
  1507.  Arguments:
  1508.  
  1509.  H,L,S (real, input): hue (0 to 360), lightness (0 to 1.0), and
  1510.        saturation (0 to 1.0).
  1511.  R,G,B (real, output): red, green, blue color coordinates, each in the
  1512.        range 0.0 to 1.0.
  1513.  
  1514. %PGADVANCE
  1515.  non-standard alias for PGPAGE
  1516.      SUBROUTINE PGADVANCE
  1517.  
  1518.  See description of PGPAGE.
  1519.  
  1520. %PGARRO
  1521.  draw an arrow
  1522.      SUBROUTINE PGARRO (X1, Y1, X2, Y2)
  1523.      REAL X1, Y1, X2, Y2
  1524.  
  1525.  Draw an arrow from the point with world-coordinates (X1,Y1) to
  1526.  (X2,Y2). The size of the arrowhead at (X2,Y2) is determined by
  1527.  the current character size set by routine PGSCH. The default size
  1528.  is 1/40th of the smaller of the width or height of the view surface.
  1529.  The appearance of the arrowhead (shape and solid or open) is
  1530.  controlled by routine PGSAH.
  1531.  
  1532.  Arguments:
  1533.   X1, Y1 (input)  : world coordinates of the tail of the arrow.
  1534.   X2, Y2 (input)  : world coordinates of the head of the arrow.
  1535.  
  1536. %PGASK
  1537.  control new page prompting
  1538.      SUBROUTINE PGASK (FLAG)
  1539.      LOGICAL FLAG
  1540.  
  1541.  Change the ``prompt state'' of PGPLOT. If the prompt state is
  1542.  ON, PGPAGE will type ``Type RETURN for next page:'' and will wait
  1543.  for the user to type a carriage-return before starting a new page.
  1544.  The initial prompt state (after the device has been opened) is ON
  1545.  for interactive devices. Prompt state is always OFF for
  1546.  non-interactive devices.
  1547.  
  1548.  Arguments:
  1549.   FLAG   (input)  : if .TRUE., and if the device is an interactive
  1550.                     device, the prompt state will be set to ON. If
  1551.                     .FALSE., the prompt state will be set to OFF.
  1552.  
  1553. %PGAXIS
  1554.  draw an axis
  1555.      SUBROUTINE PGAXIS (OPT, X1, Y1, X2, Y2, V1, V2, STEP, NSUB,
  1556.     :                   DMAJL, DMAJR, FMIN, DISP, ORIENT)
  1557.      CHARACTER*(*) OPT
  1558.      REAL X1, Y1, X2, Y2, V1, V2, STEP, DMAJL, DMAJR, FMIN, DISP
  1559.      REAL ORIENT
  1560.      INTEGER NSUB
  1561.  
  1562.  Draw a labelled graph axis from world-coordinate position (X1,Y1) to
  1563.  (X2,Y2).
  1564.  
  1565.  Normally, this routine draws a standard LINEAR axis with equal
  1566.  subdivisions.   The quantity described by the axis runs from V1 to V2;
  1567.  this may be, but need not be, the same as X or Y.
  1568.  
  1569.  If the 'L' option is specified, the routine draws a LOGARITHMIC axis.
  1570.  In this case, the quantity described by the axis runs from 10**V1 to
  1571.  10**V2. A logarithmic axis always has major, labeled, tick marks
  1572.  spaced by one or more decades. If the major tick marks are spaced
  1573.  by one decade (as specified by the STEP argument), then minor
  1574.  tick marks are placed at 2, 3, .., 9 times each power of 10;
  1575.  otherwise minor tick marks are spaced by one decade. If the axis
  1576.  spans less than two decades, numeric labels are placed at 1, 2, and
  1577.  5 times each power of ten.
  1578.  
  1579.  If the axis spans less than one decade, or if it spans many decades,
  1580.  it is preferable to use a linear axis labeled with the logarithm of
  1581.  the quantity of interest.
  1582.  
  1583.  Arguments:
  1584.   OPT    (input)  : a string containing single-letter codes for
  1585.                     various options. The options currently
  1586.                     recognized are:
  1587.                     L : draw a logarithmic axis
  1588.                     N : write numeric labels
  1589.                     1 : force decimal labelling, instead of automatic
  1590.                         choice (see PGNUMB).
  1591.                     2 : force exponential labelling, instead of
  1592.                         automatic.
  1593.   X1, Y1 (input)  : world coordinates of one endpoint of the axis.
  1594.   X2, Y2 (input)  : world coordinates of the other endpoint of the axis.
  1595.   V1     (input)  : axis value at first endpoint.
  1596.   V2     (input)  : axis value at second endpoint.
  1597.   STEP   (input)  : major tick marks are drawn at axis value 0.0 plus
  1598.                     or minus integer multiples of STEP. If STEP=0.0,
  1599.                     a value is chosen automatically.
  1600.   NSUB   (input)  : minor tick marks are drawn to divide the major
  1601.                     divisions into NSUB equal subdivisions (ignored if
  1602.                     STEP=0.0). If NSUB <= 1, no minor tick marks are
  1603.                     drawn. NSUB is ignored for a logarithmic axis.
  1604.   DMAJL  (input)  : length of major tick marks drawn to left of axis
  1605.                     (as seen looking from first endpoint to second), in
  1606.                     units of the character height.
  1607.   DMAJR  (input)  : length of major tick marks drawn to right of axis,
  1608.                     in units of the character height.
  1609.   FMIN   (input)  : length of minor tick marks, as fraction of major.
  1610.   DISP   (input)  : displacement of baseline of tick labels to
  1611.                     right of axis, in units of the character height.
  1612.   ORIENT (input)  : orientation of label text, in degrees; angle between
  1613.                     baseline of text and direction of axis (0-360°).
  1614.  
  1615. %PGBAND
  1616.  read cursor position, with anchor
  1617.      INTEGER FUNCTION PGBAND (MODE, POSN, XREF, YREF, X, Y, CH)
  1618.      INTEGER MODE, POSN
  1619.      REAL XREF, YREF, X, Y
  1620.      CHARACTER*(*) CH
  1621.  
  1622.  Read the cursor position and a character typed by the user.
  1623.  The position is returned in world coordinates.  PGBAND positions
  1624.  the cursor at the position specified (if POSN=1), allows the user to
  1625.  move the cursor using the mouse or arrow keys or whatever is available
  1626.  on the device. When he has positioned the cursor, the user types a
  1627.  single character on the keyboard; PGBAND then returns this
  1628.  character and the new cursor position (in world coordinates).
  1629.  
  1630.  Some interactive devices offer a selection of cursor types,
  1631.  implemented as thin lines that move with the cursor, but without
  1632.  erasing underlying graphics. Of these types, some extend between
  1633.  a stationary anchor-point at XREF,YREF, and the position of the
  1634.  cursor, while others simply follow the cursor without changing shape
  1635.  or size. The cursor type is specified with one of the following MODE
  1636.  values. Cursor types that are not supported by a given device, are
  1637.  treated as MODE=0.
  1638.  
  1639.  -- If MODE=0, the anchor point is ignored and the routine behaves
  1640.  like PGCURS.
  1641.  -- If MODE=1, a straight line is drawn joining the anchor point
  1642.  and the cursor position.
  1643.  -- If MODE=2, a hollow rectangle is extended as the cursor is moved,
  1644.  with one vertex at the anchor point and the opposite vertex at the
  1645.  current cursor position; the edges of the rectangle are horizontal
  1646.  and vertical.
  1647.  -- If MODE=3, two horizontal lines are extended across the width of
  1648.  the display, one drawn through the anchor point and the other
  1649.  through the moving cursor position. This could be used to select
  1650.  a Y-axis range when one end of the range is known.
  1651.  -- If MODE=4, two vertical lines are extended over the height of
  1652.  the display, one drawn through the anchor point and the other
  1653.  through the moving cursor position. This could be used to select an
  1654.  X-axis range when one end of the range is known.
  1655.  -- If MODE=5, a horizontal line is extended through the cursor
  1656.  position over the width of the display. This could be used to select
  1657.  an X-axis value such as the start of an X-axis range. The anchor point
  1658.  is ignored.
  1659.  -- If MODE=6, a vertical line is extended through the cursor
  1660.  position over the height of the display. This could be used to select
  1661.  a Y-axis value such as the start of a Y-axis range. The anchor point
  1662.  is ignored.
  1663.  -- If MODE=7, a cross-hair, centered on the cursor, is extended over
  1664.  the width and height of the display. The anchor point is ignored.
  1665.  
  1666.  Returns:
  1667.   PGBAND          : 1 if the call was successful; 0 if the device
  1668.                     has no cursor or some other error occurs.
  1669.  Arguments:
  1670.   MODE   (input)  : display mode (0, 1, ..7: see above).
  1671.   POSN   (input)  : if POSN=1, PGBAND attempts to place the cursor
  1672.                     at point (X,Y); if POSN=0, it leaves the cursor
  1673.                     at its current position. (On some devices this
  1674.                     request may be ignored.)
  1675.   XREF   (input)  : the world x-coordinate of the anchor point.
  1676.   YREF   (input)  : the world y-coordinate of the anchor point.
  1677.   X      (in/out) : the world x-coordinate of the cursor.
  1678.   Y      (in/out) : the world y-coordinate of the cursor.
  1679.   CH     (output) : the character typed by the user; if the device has
  1680.                     no cursor or if some other error occurs, the value
  1681.                     CHAR(0) [ASCII NUL character] is returned.
  1682.  
  1683.  Note: The cursor coordinates (X,Y) may be changed by PGBAND even if
  1684.  the device has no cursor or if the user does not move the cursor.
  1685.  Under these circumstances, the position returned in (X,Y) is that of
  1686.  the pixel nearest to the requested position.
  1687.  
  1688. %PGBBUF
  1689.  begin batch of output (buffer)
  1690.      SUBROUTINE PGBBUF
  1691.  
  1692.  Begin saving graphical output commands in an internal buffer; the
  1693.  commands are held until a matching PGEBUF call (or until the buffer
  1694.  is emptied by PGUPDT). This can greatly improve the efficiency of
  1695.  PGPLOT.  PGBBUF increments an internal counter, while PGEBUF
  1696.  decrements this counter and flushes the buffer to the output
  1697.  device when the counter drops to zero.  PGBBUF and PGEBUF calls
  1698.  should always be paired.
  1699.  
  1700.  Arguments: none
  1701.  
  1702. %PGBEG
  1703.  open a graphics device
  1704.      INTEGER FUNCTION PGBEG (UNIT, FILE, NXSUB, NYSUB)
  1705.      INTEGER       UNIT
  1706.      CHARACTER*(*) FILE
  1707.      INTEGER       NXSUB, NYSUB
  1708.  
  1709.  Note: new programs should use PGOPEN rather than PGBEG. PGOPEN
  1710.  is retained for compatibility with existing programs. Unlike PGOPEN,
  1711.  PGBEG closes any graphics devices that are already open, so it
  1712.  cannot be used to open devices to be used in parallel.
  1713.  
  1714.  PGBEG opens a graphical device or file and prepares it for
  1715.  subsequent plotting. A device must be opened with PGBEG or PGOPEN
  1716.  before any other calls to PGPLOT subroutines for the device.
  1717.  
  1718.  If any device  is already open for PGPLOT output, it is closed before
  1719.  the new device is opened.
  1720.  
  1721.  Returns:
  1722.   PGBEG         : a status return value. A value of 1 indicates
  1723.                     successful completion, any other value indicates
  1724.                     an error. In the event of error a message is
  1725.                     written on the standard error unit.
  1726.                     To test the return value, call
  1727.                     PGBEG as a function, eg IER=PGBEG(...); note
  1728.                     that PGBEG must be declared INTEGER in the
  1729.                     calling program. Some Fortran compilers allow
  1730.                     you to use CALL PGBEG(...) and discard the
  1731.                     return value, but this is not standard Fortran.
  1732.  Arguments:
  1733.   UNIT  (input)   : this argument is ignored by PGBEG (use zero).
  1734.   FILE  (input)   : the "device specification" for the plot device.
  1735.                     (For explanation, see description of PGOPEN.)
  1736.   NXSUB  (input)  : the number of subdivisions of the view surface in
  1737.                     X (>0 or <0).
  1738.   NYSUB  (input)  : the number of subdivisions of the view surface in
  1739.                     Y (>0).
  1740.                     PGPLOT puts NXSUB x NYSUB graphs on each plot
  1741.                     page or screen; when the view surface is sub-
  1742.                     divided in this way, PGPAGE moves to the next
  1743.                     panel, not the  next physical page. If
  1744.                     NXSUB > 0, PGPLOT uses the panels in row
  1745.                     order; if <0, PGPLOT uses them in column order.
  1746.  
  1747. %PGBEGIN
  1748.  non-standard alias for PGBEG
  1749.      INTEGER FUNCTION PGBEGIN (UNIT, FILE, NXSUB, NYSUB)
  1750.      INTEGER       UNIT
  1751.      CHARACTER*(*) FILE
  1752.      INTEGER       NXSUB, NYSUB
  1753.  
  1754.  See description of PGBEG.
  1755.  
  1756. %PGBIN
  1757.  histogram of binned data
  1758.      SUBROUTINE PGBIN (NBIN, X, DATA, CENTER)
  1759.      INTEGER NBIN
  1760.      REAL X(*), DATA(*)
  1761.      LOGICAL CENTER
  1762.  
  1763.  Plot a histogram of NBIN values with X(1..NBIN) values along
  1764.  the ordinate, and DATA(1...NBIN) along the abscissa. Bin width is
  1765.  spacing between X values.
  1766.  
  1767.  Arguments:
  1768.   NBIN   (input)  : number of values.
  1769.   X      (input)  : abscissae of bins.
  1770.   DATA   (input)  : data values of bins.
  1771.   CENTER (input)  : if .TRUE., the X values denote the center of the
  1772.                     bin; if .FALSE., the X values denote the lower
  1773.                     edge (in X) of the bin.
  1774.  
  1775. %PGBOX
  1776.  draw labeled frame around viewport
  1777.      SUBROUTINE PGBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
  1778.      CHARACTER*(*) XOPT, YOPT
  1779.      REAL XTICK, YTICK
  1780.      INTEGER NXSUB, NYSUB
  1781.  
  1782.  Annotate the viewport with frame, axes, numeric labels, etc.
  1783.  PGBOX is called by on the user's behalf by PGENV, but may also be
  1784.  called explicitly.
  1785.  
  1786.  Arguments:
  1787.   XOPT   (input)  : string of options for X (horizontal) axis of
  1788.                     plot. Options are single letters, and may be in
  1789.                     any order (see below).
  1790.   XTICK  (input)  : world coordinate interval between major tick marks
  1791.                     on X axis. If XTICK=0.0, the interval is chosen by
  1792.                     PGBOX, so that there will be at least 3 major tick
  1793.                     marks along the axis.
  1794.   NXSUB  (input)  : the number of subintervals to divide the major
  1795.                     coordinate interval into. If XTICK=0.0 or NXSUB=0,
  1796.                     the number is chosen by PGBOX.
  1797.   YOPT   (input)  : string of options for Y (vertical) axis of plot.
  1798.                     Coding is the same as for XOPT.
  1799.   YTICK  (input)  : like XTICK for the Y axis.
  1800.   NYSUB  (input)  : like NXSUB for the Y axis.
  1801.  
  1802.  Options (for parameters XOPT and YOPT):
  1803.   A : draw Axis (X axis is horizontal line Y=0, Y axis is vertical
  1804.       line X=0).
  1805.   B : draw bottom (X) or left (Y) edge of frame.
  1806.   C : draw top (X) or right (Y) edge of frame.
  1807.   G : draw Grid of vertical (X) or horizontal (Y) lines.
  1808.   I : Invert the tick marks; ie draw them outside the viewport
  1809.       instead of inside.
  1810.   L : label axis Logarithmically (see below).
  1811.   N : write Numeric labels in the conventional location below the
  1812.       viewport (X) or to the left of the viewport (Y).
  1813.   P : extend ("Project") major tick marks outside the box (ignored if
  1814.       option I is specified).
  1815.   M : write numeric labels in the unconventional location above the
  1816.       viewport (X) or to the right of the viewport (Y).
  1817.   T : draw major Tick marks at the major coordinate interval.
  1818.   S : draw minor tick marks (Subticks).
  1819.   V : orient numeric labels Vertically. This is only applicable to Y.
  1820.       The default is to write Y-labels parallel to the axis.
  1821.   1 : force decimal labelling, instead of automatic choice (see PGNUMB).
  1822.   2 : force exponential labelling, instead of automatic.
  1823.  
  1824.  To get a complete frame, specify BC in both XOPT and YOPT.
  1825.  Tick marks, if requested, are drawn on the axes or frame
  1826.  or both, depending which are requested. If none of ABC is specified,
  1827.  tick marks will not be drawn. When PGENV calls PGBOX, it sets both
  1828.  XOPT and YOPT according to the value of its parameter AXIS:
  1829.  -1: 'BC', 0: 'BCNST', 1: 'ABCNST', 2: 'ABCGNST'.
  1830.  
  1831.  For a logarithmic axis, the major tick interval is always 1.0. The
  1832.  numeric label is 10**(x) where x is the world coordinate at the
  1833.  tick mark. If subticks are requested, 8 subticks are drawn between
  1834.  each major tick at equal logarithmic intervals.
  1835.  
  1836.  To label an axis with time (days, hours, minutes, seconds) or
  1837.  angle (degrees, arcmin, arcsec), use routine PGTBOX.
  1838.  
  1839. %PGCIRC
  1840.  draw a circle, using fill-area attributes
  1841.      SUBROUTINE PGCIRC (XCENT, YCENT, RADIUS)
  1842.      REAL XCENT, YCENT, RADIUS
  1843.  
  1844.  Draw a circle. The action of this routine depends
  1845.  on the setting of the Fill-Area Style attribute. If Fill-Area Style
  1846.  is SOLID (the default), the interior of the circle is solid-filled
  1847.  using the current Color Index. If Fill-Area Style is HOLLOW, the
  1848.  outline of the circle is drawn using the current line attributes
  1849.  (color index, line-style, and line-width).
  1850.  
  1851.  Arguments:
  1852.   XCENT  (input)  : world x-coordinate of the center of the circle.
  1853.   YCENT  (input)  : world y-coordinate of the center of the circle.
  1854.   RADIUS (input)  : radius of circle (world coordinates).
  1855.  
  1856. %PGCLOS
  1857.  close the selected graphics device
  1858.      SUBROUTINE PGCLOS
  1859.  
  1860.  Close the currently selected graphics device. After the device has
  1861.  been closed, either another open device must be selected with PGSLCT
  1862.  or another device must be opened with PGOPEN before any further
  1863.  plotting can be done. If the call to PGCLOS is omitted, some or all
  1864.  of the plot may be lost.
  1865.  
  1866.  [This routine was added to PGPLOT in Version 5.1.0. Older programs
  1867.  use PGEND instead.]
  1868.  
  1869.  Arguments: none
  1870.  
  1871. %PGCONB
  1872.  contour map of a 2D data array, with blanking
  1873.      SUBROUTINE PGCONB (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR,
  1874.     1                   BLANK)
  1875.      INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  1876.      REAL    A(IDIM,JDIM), C(*), TR(6), BLANK
  1877.  
  1878.  Draw a contour map of an array. This routine is the same as PGCONS,
  1879.  except that array elements that have the "magic value" defined by
  1880.  argument BLANK are ignored, making gaps in the contour map. The
  1881.  routine may be useful for data measured on most but not all of the
  1882.  points of a grid.
  1883.  
  1884.  Arguments:
  1885.   A      (input)  : data array.
  1886.   IDIM   (input)  : first dimension of A.
  1887.   JDIM   (input)  : second dimension of A.
  1888.   I1,I2  (input)  : range of first index to be contoured (inclusive).
  1889.   J1,J2  (input)  : range of second index to be contoured (inclusive).
  1890.   C      (input)  : array of contour levels (in the same units as the
  1891.                     data in array A); dimension at least NC.
  1892.   NC     (input)  : number of contour levels (less than or equal to
  1893.                     dimension of C). The absolute value of this
  1894.                     argument is used (for compatibility with PGCONT,
  1895.                     where the sign of NC is significant).
  1896.   TR     (input)  : array defining a transformation between the I,J
  1897.                     grid of the array and the world coordinates. The
  1898.                     world coordinates of the array point A(I,J) are
  1899.                     given by:
  1900.                       X = TR(1) + TR(2)*I + TR(3)*J
  1901.                       Y = TR(4) + TR(5)*I + TR(6)*J
  1902.                     Usually TR(3) and TR(5) are zero - unless the
  1903.                     coordinate transformation involves a rotation
  1904.                     or shear.
  1905.   BLANK   (input) : elements of array A that are exactly equal to
  1906.                     this value are ignored (blanked).
  1907.  
  1908. %PGCONF
  1909.  fill between two contours
  1910.      SUBROUTINE PGCONF (A, IDIM, JDIM, I1, I2, J1, J2, C1, C2, TR)
  1911.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  1912.      REAL    A(IDIM,JDIM), C1, C2, TR(6)
  1913.  
  1914.  Shade the region between two contour levels of a function defined on
  1915.  the nodes of a rectangular grid. The routine uses the current fill
  1916.  attributes, hatching style (if appropriate), and color index.
  1917.  
  1918.  If you want to both shade between contours and draw the contour
  1919.  lines, call this routine first (once for each pair of levels) and
  1920.  then CALL PGCONT (or PGCONS) to draw the contour lines on top of the
  1921.  shading.
  1922.  
  1923.  Note 1: This routine is not very efficient: it generates a polygon
  1924.  fill command for each cell of the mesh that intersects the desired
  1925.  area, rather than consolidating adjacent cells into a single polygon.
  1926.  
  1927.  Note 2: If both contours intersect all four edges of a particular
  1928.  mesh cell, the program behaves badly and may consider some parts
  1929.  of the cell to lie in more than one contour range.
  1930.  
  1931.  Note 3: If a contour crosses all four edges of a cell, this
  1932.  routine may not generate the same contours as PGCONT or PGCONS
  1933.  (these two routines may not agree either). Such cases are always
  1934.  ambiguous and the routines use different approaches to resolving
  1935.  the ambiguity.
  1936.  
  1937.  Arguments:
  1938.   A      (input)  : data array.
  1939.   IDIM   (input)  : first dimension of A.
  1940.   JDIM   (input)  : second dimension of A.
  1941.   I1,I2  (input)  : range of first index to be contoured (inclusive).
  1942.   J1,J2  (input)  : range of second index to be contoured (inclusive).
  1943.   C1, C2 (input)  : contour levels; note that C1 must be less than C2.
  1944.   TR     (input)  : array defining a transformation between the I,J
  1945.                     grid of the array and the world coordinates. The
  1946.                     world coordinates of the array point A(I,J) are
  1947.                     given by:
  1948.                       X = TR(1) + TR(2)*I + TR(3)*J
  1949.                       Y = TR(4) + TR(5)*I + TR(6)*J
  1950.                     Usually TR(3) and TR(5) are zero - unless the
  1951.                     coordinate transformation involves a rotation
  1952.                     or shear.
  1953.  
  1954. %PGCONL
  1955.  label contour map of a 2D data array
  1956.      SUBROUTINE PGCONL (A, IDIM, JDIM, I1, I2, J1, J2, C, TR,
  1957.     1                   LABEL, INTVAL, MININT)
  1958.      INTEGER IDIM, JDIM, I1, J1, I2, J2, INTVAL, MININT
  1959.      REAL A(IDIM,JDIM), C, TR(6)
  1960.      CHARACTER*(*) LABEL
  1961.  
  1962.  Label a contour map drawn with routine PGCONT. Routine PGCONT should
  1963.  be called first to draw the contour lines, then this routine should be
  1964.  called to add the labels. Labels are written at intervals along the
  1965.  contour lines, centered on the contour lines with lettering aligned
  1966.  in the up-hill direction. Labels are opaque, so a part of the under-
  1967.  lying contour line is obscured by the label. Labels use the current
  1968.  attributes (character height, line width, color index, character
  1969.  font).
  1970.  
  1971.  The first 9 arguments are the same as those supplied to PGCONT, and
  1972.  should normally be identical to those used with PGCONT. Note that
  1973.  only one contour level can be specified; tolabel more contours, call
  1974.  PGCONL for each level.
  1975.  
  1976.  The Label is supplied as a character string in argument LABEL.
  1977.  
  1978.  The spacing of labels along the contour is specified by parameters
  1979.  INTVAL and MININT. The routine follows the contour through the
  1980.  array, counting the number of cells that the contour crosses. The
  1981.  first label will be written in the MININT'th cell, and additional
  1982.  labels will be written every INTVAL cells thereafter. A contour
  1983.  that crosses less than MININT cells will not be labelled. Some
  1984.  experimentation may be needed to get satisfactory results; a good
  1985.  place to start is INTVAL=20, MININT=10.
  1986.  
  1987.  Arguments:
  1988.   A      (input) : data array.
  1989.   IDIM   (input) : first dimension of A.
  1990.   JDIM   (input) : second dimension of A.
  1991.   I1, I2 (input) : range of first index to be contoured (inclusive).
  1992.   J1, J2 (input) : range of second index to be contoured (inclusive).
  1993.   C      (input) : the level of the contour to be labelled (one of the
  1994.                    values given to PGCONT).
  1995.   TR     (input) : array defining a transformation between the I,J
  1996.                    grid of the array and the world coordinates.
  1997.                    The world coordinates of the array point A(I,J)
  1998.                    are given by:
  1999.                      X = TR(1) + TR(2)*I + TR(3)*J
  2000.                      Y = TR(4) + TR(5)*I + TR(6)*J
  2001.                    Usually TR(3) and TR(5) are zero - unless the
  2002.                    coordinate transformation involves a rotation or
  2003.                    shear.
  2004.   LABEL  (input) : character strings to be used to label the specified
  2005.                    contour. Leading and trailing blank spaces are
  2006.                    ignored.
  2007.   INTVAL (input) : spacing along the contour between labels, in
  2008.                    grid cells.
  2009.   MININT (input) : contours that cross less than MININT cells
  2010.                    will not be labelled.
  2011.  
  2012. %PGCONS
  2013.  contour map of a 2D data array (fast algorithm)
  2014.      SUBROUTINE PGCONS (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
  2015.      INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  2016.      REAL    A(IDIM,JDIM), C(*), TR(6)
  2017.  
  2018.  Draw a contour map of an array. The map is truncated if
  2019.  necessary at the boundaries of the viewport.  Each contour line is
  2020.  drawn with the current line attributes (color index, style, and
  2021.  width).  This routine, unlike PGCONT, does not draw each contour as a
  2022.  continuous line, but draws the straight line segments composing each
  2023.  contour in a random order.  It is thus not suitable for use on pen
  2024.  plotters, and it usually gives unsatisfactory results with dashed or
  2025.  dotted lines.  It is, however, faster than PGCONT, especially if
  2026.  several contour levels are drawn with one call of PGCONS.
  2027.  
  2028.  Arguments:
  2029.   A      (input)  : data array.
  2030.   IDIM   (input)  : first dimension of A.
  2031.   JDIM   (input)  : second dimension of A.
  2032.   I1,I2  (input)  : range of first index to be contoured (inclusive).
  2033.   J1,J2  (input)  : range of second index to be contoured (inclusive).
  2034.   C      (input)  : array of contour levels (in the same units as the
  2035.                     data in array A); dimension at least NC.
  2036.   NC     (input)  : number of contour levels (less than or equal to
  2037.                     dimension of C). The absolute value of this
  2038.                     argument is used (for compatibility with PGCONT,
  2039.                     where the sign of NC is significant).
  2040.   TR     (input)  : array defining a transformation between the I,J
  2041.                     grid of the array and the world coordinates. The
  2042.                     world coordinates of the array point A(I,J) are
  2043.                     given by:
  2044.                       X = TR(1) + TR(2)*I + TR(3)*J
  2045.                       Y = TR(4) + TR(5)*I + TR(6)*J
  2046.                     Usually TR(3) and TR(5) are zero - unless the
  2047.                     coordinate transformation involves a rotation
  2048.                     or shear.
  2049.  
  2050. %PGCONT
  2051.  contour map of a 2D data array (contour-following)
  2052.      SUBROUTINE PGCONT (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
  2053.      INTEGER IDIM, JDIM, I1, J1, I2, J2, NC
  2054.      REAL A(IDIM,JDIM), C(*), TR(6)
  2055.  
  2056.  Draw a contour map of an array.  The map is truncated if
  2057.  necessary at the boundaries of the viewport.  Each contour line
  2058.  is drawn with the current line attributes (color index, style, and
  2059.  width); except that if argument NC is positive (see below), the line
  2060.  style is set by PGCONT to 1 (solid) for positive contours or 2
  2061.  (dashed) for negative contours.
  2062.  
  2063.  Arguments:
  2064.   A      (input) : data array.
  2065.   IDIM   (input) : first dimension of A.
  2066.   JDIM   (input) : second dimension of A.
  2067.   I1, I2 (input) : range of first index to be contoured (inclusive).
  2068.   J1, J2 (input) : range of second index to be contoured (inclusive).
  2069.   C      (input) : array of NC contour levels; dimension at least NC.
  2070.   NC     (input) : +/- number of contour levels (less than or equal
  2071.                    to dimension of C). If NC is positive, it is the
  2072.                    number of contour levels, and the line-style is
  2073.                    chosen automatically as described above. If NC is
  2074.                    negative, it is minus the number of contour
  2075.                    levels, and the current setting of line-style is
  2076.                    used for all the contours.
  2077.   TR     (input) : array defining a transformation between the I,J
  2078.                    grid of the array and the world coordinates.
  2079.                    The world coordinates of the array point A(I,J)
  2080.                    are given by:
  2081.                      X = TR(1) + TR(2)*I + TR(3)*J
  2082.                      Y = TR(4) + TR(5)*I + TR(6)*J
  2083.                    Usually TR(3) and TR(5) are zero - unless the
  2084.                    coordinate transformation involves a rotation or
  2085.                    shear.
  2086.  
  2087. %PGCONX
  2088.  contour map of a 2D data array (non rectangular)
  2089.      SUBROUTINE PGCONX (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, PLOT)
  2090.      INTEGER  IDIM, JDIM, I1, J1, I2, J2, NC
  2091.      REAL     A(IDIM,JDIM), C(*)
  2092.      EXTERNAL PLOT
  2093.  
  2094.  Draw a contour map of an array using a user-supplied plotting
  2095.  routine.  This routine should be used instead of PGCONT when the
  2096.  data are defined on a non-rectangular grid.  PGCONT permits only
  2097.  a linear transformation between the (I,J) grid of the array
  2098.  and the world coordinate system (x,y), but PGCONX permits any
  2099.  transformation to be used, the transformation being defined by a
  2100.  user-supplied subroutine. The nature of the contouring algorithm,
  2101.  however, dictates that the transformation should maintain the
  2102.  rectangular topology of the grid, although grid-points may be
  2103.  allowed to coalesce.  As an example of a deformed rectangular
  2104.  grid, consider data given on the polar grid theta=0.1n(pi/2),
  2105.  for n=0,1,...,10, and r=0.25m, for m=0,1,..,4. This grid
  2106.  contains 55 points, of which 11 are coincident at the origin.
  2107.  The input array for PGCONX should be dimensioned (11,5), and
  2108.  data values should be provided for all 55 elements.  PGCONX can
  2109.  also be used for special applications in which the height of the
  2110.  contour affects its appearance, e.g., stereoscopic views.
  2111.  
  2112.  The map is truncated if necessary at the boundaries of the viewport.
  2113.  Each contour line is drawn with the current line attributes (color
  2114.  index, style, and width); except that if argument NC is positive
  2115.  (see below), the line style is set by PGCONX to 1 (solid) for
  2116.  positive contours or 2 (dashed) for negative contours. Attributes
  2117.  for the contour lines can also be set in the user-supplied
  2118.  subroutine, if desired.
  2119.  
  2120.  Arguments:
  2121.   A      (input) : data array.
  2122.   IDIM   (input) : first dimension of A.
  2123.   JDIM   (input) : second dimension of A.
  2124.   I1, I2 (input) : range of first index to be contoured (inclusive).
  2125.   J1, J2 (input) : range of second index to be contoured (inclusive).
  2126.   C      (input) : array of NC contour levels; dimension at least NC.
  2127.   NC     (input) : +/- number of contour levels (less than or equal
  2128.                    to dimension of C). If NC is positive, it is the
  2129.                    number of contour levels, and the line-style is
  2130.                    chosen automatically as described above. If NC is
  2131.                    negative, it is minus the number of contour
  2132.                    levels, and the current setting of line-style is
  2133.                    used for all the contours.
  2134.   PLOT   (input) : the address (name) of a subroutine supplied by
  2135.                    the user, which will be called by PGCONX to do
  2136.                    the actual plotting. This must be declared
  2137.                    EXTERNAL in the program unit calling PGCONX.
  2138.  
  2139.  The subroutine PLOT will be called with four arguments:
  2140.       CALL PLOT(VISBLE,X,Y,Z)
  2141.  where X,Y (input) are real variables corresponding to
  2142.  I,J indices of the array A. If  VISBLE (input, integer) is 1,
  2143.  PLOT should draw a visible line from the current pen
  2144.  position to the world coordinate point corresponding to (X,Y);
  2145.  if it is 0, it should move the pen to (X,Y). Z is the value
  2146.  of the current contour level, and may be used by PLOT if desired.
  2147.  Example:
  2148.        SUBROUTINE PLOT (VISBLE,X,Y,Z)
  2149.        REAL X, Y, Z, XWORLD, YWORLD
  2150.        INTEGER VISBLE
  2151.        XWORLD = X*COS(Y) ! this is the user-defined
  2152.        YWORLD = X*SIN(Y) ! transformation
  2153.        IF (VISBLE.EQ.0) THEN
  2154.            CALL PGMOVE (XWORLD, YWORLD)
  2155.        ELSE
  2156.            CALL PGDRAW (XWORLD, YWORLD)
  2157.        END IF
  2158.        END
  2159.  
  2160. %PGCTAB
  2161.  install the color table to be used by PGIMAG
  2162.      SUBROUTINE PGCTAB(L, R, G, B, NC, CONTRA, BRIGHT)
  2163.      INTEGER NC
  2164.      REAL    L(NC), R(NC), G(NC), B(NC), CONTRA, BRIGHT
  2165.  
  2166.  Use the given color table to change the color representations of
  2167.  all color indexes marked for use by PGIMAG. To change which
  2168.  color indexes are thus marked, call PGSCIR before calling PGCTAB
  2169.  or PGIMAG. On devices that can change the color representations
  2170.  of previously plotted graphics, PGCTAB will also change the colors
  2171.  of existing graphics that were plotted with the marked color
  2172.  indexes. This feature can then be combined with PGBAND to
  2173.  interactively manipulate the displayed colors of data previously
  2174.  plotted with PGIMAG.
  2175.  
  2176.  Limitations:
  2177.   1. Some devices do not propagate color representation changes
  2178.      to previously drawn graphics.
  2179.   2. Some devices ignore requests to change color representations.
  2180.   3. The appearance of specific color representations on grey-scale
  2181.      devices is device-dependent.
  2182.  
  2183.  Notes:
  2184.   To reverse the sense of a color table, change the chosen contrast
  2185.   and brightness to -CONTRA and 1-BRIGHT.
  2186.  
  2187.   In the following, the term 'color table' refers to the input
  2188.   L,R,G,B arrays, whereas 'color ramp' refers to the resulting
  2189.   ramp of colors that would be seen with PGWEDG.
  2190.  
  2191.  Arguments:
  2192.   L      (input)  : An array of NC normalized ramp-intensity levels
  2193.                     corresponding to the RGB primary color intensities
  2194.                     in R(),G(),B(). Colors on the ramp are linearly
  2195.                     interpolated from neighbouring levels.
  2196.                     Levels must be sorted in increasing order.
  2197.                      0.0 places a color at the beginning of the ramp.
  2198.                      1.0 places a color at the end of the ramp.
  2199.                     Colors outside these limits are legal, but will
  2200.                     not be visible if CONTRA=1.0 and BRIGHT=0.5.
  2201.   R      (input)  : An array of NC normalized red intensities.
  2202.   G      (input)  : An array of NC normalized green intensities.
  2203.   B      (input)  : An array of NC normalized blue intensities.
  2204.   NC     (input)  : The number of color table entries.
  2205.   CONTRA (input)  : The contrast of the color ramp (normally 1.0).
  2206.                     Negative values reverse the direction of the ramp.
  2207.   BRIGHT (input)  : The brightness of the color ramp. This is normally
  2208.                     0.5, but can sensibly hold any value between 0.0
  2209.                     and 1.0. Values at or beyond the latter two
  2210.                     extremes, saturate the color ramp with the colors
  2211.                     of the respective end of the color table.
  2212.  
  2213. %PGCURS
  2214.  read cursor position
  2215.      INTEGER FUNCTION PGCURS (X, Y, CH)
  2216.      REAL X, Y
  2217.      CHARACTER*(*) CH
  2218.  
  2219.  Read the cursor position and a character typed by the user.
  2220.  The position is returned in world coordinates.  PGCURS positions
  2221.  the cursor at the position specified, allows the user to move the
  2222.  cursor using the joystick or arrow keys or whatever is available on
  2223.  the device. When he has positioned the cursor, the user types a
  2224.  single character on the keyboard; PGCURS then returns this
  2225.  character and the new cursor position (in world coordinates).
  2226.  
  2227.  Returns:
  2228.   PGCURS         : 1 if the call was successful; 0 if the device
  2229.                     has no cursor or some other error occurs.
  2230.  Arguments:
  2231.   X      (in/out) : the world x-coordinate of the cursor.
  2232.   Y      (in/out) : the world y-coordinate of the cursor.
  2233.   CH     (output) : the character typed by the user; if the device has
  2234.                     no cursor or if some other error occurs, the value
  2235.                     CHAR(0) [ASCII NUL character] is returned.
  2236.  
  2237.  Note: The cursor coordinates (X,Y) may be changed by PGCURS even if
  2238.  the device has no cursor or if the user does not move the cursor.
  2239.  Under these circumstances, the position returned in (X,Y) is that of
  2240.  the pixel nearest to the requested position.
  2241.  
  2242. %PGCURSE
  2243.  non-standard alias for PGCURS
  2244.      INTEGER FUNCTION PGCURSE (X, Y, CH)
  2245.      REAL X, Y
  2246.      CHARACTER*1 CH
  2247.  
  2248.  See description of PGCURS.
  2249.  
  2250. %PGDRAW
  2251.  draw a line from the current pen position to a point
  2252.      SUBROUTINE PGDRAW (X, Y)
  2253.      REAL X, Y
  2254.  
  2255.  Draw a line from the current pen position to the point
  2256.  with world-coordinates (X,Y). The line is clipped at the edge of the
  2257.  current window. The new pen position is (X,Y) in world coordinates.
  2258.  
  2259.  Arguments:
  2260.   X      (input)  : world x-coordinate of the end point of the line.
  2261.   Y      (input)  : world y-coordinate of the end point of the line.
  2262.  
  2263. %PGEBUF
  2264.  end batch of output (buffer)
  2265.      SUBROUTINE PGEBUF
  2266.  
  2267.  A call to PGEBUF marks the end of a batch of graphical output begun
  2268.  with the last call of PGBBUF.  PGBBUF and PGEBUF calls should always
  2269.  be paired. Each call to PGBBUF increments a counter, while each call
  2270.  to PGEBUF decrements the counter. When the counter reaches 0, the
  2271.  batch of output is written on the output device.
  2272.  
  2273.  Arguments: none
  2274.  
  2275. %PGEND
  2276.  close all open graphics devices
  2277.      SUBROUTINE PGEND
  2278.  
  2279.  Close and release any open graphics devices. All devices must be
  2280.  closed by calling either PGCLOS (for each device) or PGEND before
  2281.  the program terminates. If a device is not closed properly, some
  2282.  or all of the graphical output may be lost.
  2283.  
  2284.  Arguments: none
  2285.  
  2286. %PGENV
  2287.  set window and viewport and draw labeled frame
  2288.      SUBROUTINE PGENV (XMIN, XMAX, YMIN, YMAX, JUST, AXIS)
  2289.      REAL XMIN, XMAX, YMIN, YMAX
  2290.      INTEGER JUST, AXIS
  2291.  
  2292.  Set PGPLOT "Plotter Environment".  PGENV establishes the scaling
  2293.  for subsequent calls to PGPT, PGLINE, etc.  The plotter is
  2294.  advanced to a new page or panel, clearing the screen if necessary.
  2295.  If the "prompt state" is ON (see PGASK), confirmation
  2296.  is requested from the user before clearing the screen.
  2297.  If requested, a box, axes, labels, etc. are drawn according to
  2298.  the setting of argument AXIS.
  2299.  
  2300.  Arguments:
  2301.   XMIN   (input)  : the world x-coordinate at the bottom left corner
  2302.                     of the viewport.
  2303.   XMAX   (input)  : the world x-coordinate at the top right corner
  2304.                     of the viewport (note XMAX may be less than XMIN).
  2305.   YMIN   (input)  : the world y-coordinate at the bottom left corner
  2306.                     of the viewport.
  2307.   YMAX   (input)  : the world y-coordinate at the top right corner
  2308.                     of the viewport (note YMAX may be less than YMIN).
  2309.   JUST   (input)  : if JUST=1, the scales of the x and y axes (in
  2310.                     world coordinates per inch) will be equal,
  2311.                     otherwise they will be scaled independently.
  2312.   AXIS   (input)  : controls the plotting of axes, tick marks, etc:
  2313.       AXIS = -2 : draw no box, axes or labels;
  2314.       AXIS = -1 : draw box only;
  2315.       AXIS =  0 : draw box and label it with coordinates;
  2316.       AXIS =  1 : same as AXIS=0, but also draw the
  2317.                   coordinate axes (X=0, Y=0);
  2318.       AXIS =  2 : same as AXIS=1, but also draw grid lines
  2319.                   at major increments of the coordinates;
  2320.       AXIS = 10 : draw box and label X-axis logarithmically;
  2321.       AXIS = 20 : draw box and label Y-axis logarithmically;
  2322.       AXIS = 30 : draw box and label both axes logarithmically.
  2323.  
  2324.  For other axis options, use routine PGBOX. PGENV can be persuaded to
  2325.  call PGBOX with additional axis options by defining an environment
  2326.  parameter PGPLOT_ENVOPT containing the required option codes.
  2327.  Examples:
  2328.    PGPLOT_ENVOPT=P      ! draw Projecting tick marks
  2329.    PGPLOT_ENVOPT=I      ! Invert the tick marks
  2330.    PGPLOT_ENVOPT=IV     ! Invert tick marks and label y Vertically
  2331.  
  2332. %PGERAS
  2333.  erase all graphics from current page
  2334.      SUBROUTINE PGERAS
  2335.  
  2336.  Erase all graphics from the current page (or current panel, if
  2337.  the view surface has been divided into panels with PGSUBP).
  2338.  
  2339.  Arguments: none
  2340.  
  2341. %PGERR1
  2342.  horizontal or vertical error bar
  2343.      SUBROUTINE PGERR1 (DIR, X, Y, E, T)
  2344.      INTEGER DIR
  2345.      REAL X, Y, E
  2346.      REAL T
  2347.  
  2348.  Plot a single error bar in the direction specified by DIR.
  2349.  This routine draws an error bar only; to mark the data point at
  2350.  the start of the error bar, an additional call to PGPT is required.
  2351.  To plot many error bars, use PGERRB.
  2352.  
  2353.  Arguments:
  2354.   DIR    (input)  : direction to plot the error bar relative to
  2355.                     the data point.
  2356.                     One-sided error bar:
  2357.                       DIR is 1 for +X (X to X+E);
  2358.                              2 for +Y (Y to Y+E);
  2359.                              3 for -X (X to X-E);
  2360.                              4 for -Y (Y to Y-E).
  2361.                     Two-sided error bar:
  2362.                       DIR is 5 for +/-X (X-E to X+E);
  2363.                              6 for +/-Y (Y-E to Y+E).
  2364.   X      (input)  : world x-coordinate of the data.
  2365.   Y      (input)  : world y-coordinate of the data.
  2366.   E      (input)  : value of error bar distance to be added to the
  2367.                     data position in world coordinates.
  2368.   T      (input)  : length of terminals to be drawn at the ends
  2369.                     of the error bar, as a multiple of the default
  2370.                     length; if T = 0.0, no terminals will be drawn.
  2371.  
  2372. %PGERRB
  2373.  horizontal or vertical error bar
  2374.      SUBROUTINE PGERRB (DIR, N, X, Y, E, T)
  2375.      INTEGER DIR, N
  2376.      REAL X(*), Y(*), E(*)
  2377.      REAL T
  2378.  
  2379.  Plot error bars in the direction specified by DIR.
  2380.  This routine draws an error bar only; to mark the data point at
  2381.  the start of the error bar, an additional call to PGPT is required.
  2382.  
  2383.  Arguments:
  2384.   DIR    (input)  : direction to plot the error bar relative to
  2385.                     the data point.
  2386.                     One-sided error bar:
  2387.                       DIR is 1 for +X (X to X+E);
  2388.                              2 for +Y (Y to Y+E);
  2389.                              3 for -X (X to X-E);
  2390.                              4 for -Y (Y to Y-E).
  2391.                     Two-sided error bar:
  2392.                       DIR is 5 for +/-X (X-E to X+E);
  2393.                              6 for +/-Y (Y-E to Y+E).
  2394.   N      (input)  : number of error bars to plot.
  2395.   X      (input)  : world x-coordinates of the data.
  2396.   Y      (input)  : world y-coordinates of the data.
  2397.   E      (input)  : value of error bar distance to be added to the
  2398.                     data position in world coordinates.
  2399.   T      (input)  : length of terminals to be drawn at the ends
  2400.                     of the error bar, as a multiple of the default
  2401.                     length; if T = 0.0, no terminals will be drawn.
  2402.  
  2403.  Note: the dimension of arrays X, Y, and E must be greater
  2404.  than or equal to N. If N is 1, X, Y, and E may be scalar
  2405.  variables, or expressions.
  2406.  
  2407. %PGERRX
  2408.  horizontal error bar
  2409.      SUBROUTINE PGERRX (N, X1, X2, Y, T)
  2410.      INTEGER N
  2411.      REAL X1(*), X2(*), Y(*)
  2412.      REAL T
  2413.  
  2414.  Plot horizontal error bars.
  2415.  This routine draws an error bar only; to mark the data point in
  2416.  the middle of the error bar, an additional call to PGPT or
  2417.  PGERRY is required.
  2418.  
  2419.  Arguments:
  2420.   N      (input)  : number of error bars to plot.
  2421.   X1     (input)  : world x-coordinates of lower end of the
  2422.                     error bars.
  2423.   X2     (input)  : world x-coordinates of upper end of the
  2424.                     error bars.
  2425.   Y      (input)  : world y-coordinates of the data.
  2426.   T      (input)  : length of terminals to be drawn at the ends
  2427.                     of the error bar, as a multiple of the default
  2428.                     length; if T = 0.0, no terminals will be drawn.
  2429.  
  2430.  Note: the dimension of arrays X1, X2, and Y must be greater
  2431.  than or equal to N. If N is 1, X1, X2, and Y may be scalar
  2432.  variables, or expressions, eg:
  2433.        CALL PGERRX(1,X-SIGMA,X+SIGMA,Y)
  2434.  
  2435. %PGERRY
  2436.  vertical error bar
  2437.      SUBROUTINE PGERRY (N, X, Y1, Y2, T)
  2438.      INTEGER N
  2439.      REAL X(*), Y1(*), Y2(*)
  2440.      REAL T
  2441.  
  2442.  Plot vertical error bars.
  2443.  This routine draws an error bar only; to mark the data point in
  2444.  the middle of the error bar, an additional call to PGPT or
  2445.  PGERRX is required.
  2446.  
  2447.  Arguments:
  2448.   N      (input)  : number of error bars to plot.
  2449.   X      (input)  : world x-coordinates of the data.
  2450.   Y1     (input)  : world y-coordinates of top end of the
  2451.                     error bars.
  2452.   Y2     (input)  : world y-coordinates of bottom end of the
  2453.                     error bars.
  2454.   T      (input)  : length of terminals to be drawn at the ends
  2455.                     of the error bar, as a multiple of the default
  2456.                     length; if T = 0.0, no terminals will be drawn.
  2457.  
  2458.  Note: the dimension of arrays X, Y1, and Y2 must be greater
  2459.  than or equal to N. If N is 1, X, Y1, and Y2 may be scalar
  2460.  variables or expressions, eg:
  2461.        CALL PGERRY(1,X,Y+SIGMA,Y-SIGMA)
  2462.  
  2463. %PGETXT
  2464.  erase text from graphics display
  2465.      SUBROUTINE PGETXT
  2466.  
  2467.  Some graphics terminals display text (the normal interactive dialog)
  2468.  on the same screen as graphics. This routine erases the text from the
  2469.  view surface without affecting the graphics. It does nothing on
  2470.  devices which do not display text on the graphics screen, and on
  2471.  devices which do not have this capability.
  2472.  
  2473.  Arguments:
  2474.   None
  2475.  
  2476. %PGFUNT
  2477.  function defined by X = F(T), Y = G(T)
  2478.      SUBROUTINE PGFUNT (FX, FY, N, TMIN, TMAX, PGFLAG)
  2479.      REAL FX, FY
  2480.      EXTERNAL FX, FY
  2481.      INTEGER N
  2482.      REAL TMIN, TMAX
  2483.      INTEGER PGFLAG
  2484.  
  2485.  Draw a curve defined by parametric equations X = FX(T), Y = FY(T).
  2486.  
  2487.  Arguments:
  2488.   FX     (external real function): supplied by the user, evaluates
  2489.                     X-coordinate.
  2490.   FY     (external real function): supplied by the user, evaluates
  2491.                     Y-coordinate.
  2492.   N      (input)  : the number of points required to define the
  2493.                     curve. The functions FX and FY will each be
  2494.                     called N+1 times.
  2495.   TMIN   (input)  : the minimum value for the parameter T.
  2496.   TMAX   (input)  : the maximum value for the parameter T.
  2497.   PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  2498.                     current window and viewport; if PGFLAG = 0,
  2499.                     PGENV is called automatically by PGFUNT to
  2500.                     start a new plot with automatic scaling.
  2501.  
  2502.  Note: The functions FX and FY must be declared EXTERNAL in the
  2503.  Fortran program unit that calls PGFUNT.
  2504.  
  2505. %PGFUNX
  2506.  function defined by Y = F(X)
  2507.      SUBROUTINE PGFUNX (FY, N, XMIN, XMAX, PGFLAG)
  2508.      REAL FY
  2509.      EXTERNAL FY
  2510.      INTEGER N
  2511.      REAL XMIN, XMAX
  2512.      INTEGER PGFLAG
  2513.  
  2514.  Draw a curve defined by the equation Y = FY(X), where FY is a
  2515.  user-supplied subroutine.
  2516.  
  2517.  Arguments:
  2518.   FY     (external real function): supplied by the user, evaluates
  2519.                     Y value at a given X-coordinate.
  2520.   N      (input)  : the number of points required to define the
  2521.                     curve. The function FY will be called N+1 times.
  2522.                     If PGFLAG=0 and N is greater than 1000, 1000
  2523.                     will be used instead.  If N is less than 1,
  2524.                     nothing will be drawn.
  2525.   XMIN   (input)  : the minimum value of X.
  2526.   XMAX   (input)  : the maximum value of X.
  2527.   PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  2528.                     current window and viewport; if PGFLAG = 0,
  2529.                     PGENV is called automatically by PGFUNX to
  2530.                     start a new plot with X limits (XMIN, XMAX)
  2531.                     and automatic scaling in Y.
  2532.  
  2533.  Note: The function FY must be declared EXTERNAL in the Fortran
  2534.  program unit that calls PGFUNX.  It has one argument, the
  2535.  x-coordinate at which the y value is required, e.g.
  2536.    REAL FUNCTION FY(X)
  2537.    REAL X
  2538.    FY = .....
  2539.    END
  2540.  
  2541. %PGFUNY
  2542.  function defined by X = F(Y)
  2543.      SUBROUTINE PGFUNY (FX, N, YMIN, YMAX, PGFLAG)
  2544.      REAL    FX
  2545.      EXTERNAL FX
  2546.      INTEGER N
  2547.      REAL    YMIN, YMAX
  2548.      INTEGER PGFLAG
  2549.  
  2550.  Draw a curve defined by the equation X = FX(Y), where FY is a
  2551.  user-supplied subroutine.
  2552.  
  2553.  Arguments:
  2554.   FX     (external real function): supplied by the user, evaluates
  2555.                     X value at a given Y-coordinate.
  2556.   N      (input)  : the number of points required to define the
  2557.                     curve. The function FX will be called N+1 times.
  2558.                     If PGFLAG=0 and N is greater than 1000, 1000
  2559.                     will be used instead.  If N is less than 1,
  2560.                     nothing will be drawn.
  2561.   YMIN   (input)  : the minimum value of Y.
  2562.   YMAX   (input)  : the maximum value of Y.
  2563.   PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  2564.                     current window and viewport; if PGFLAG = 0,
  2565.                     PGENV is called automatically by PGFUNY to
  2566.                     start a new plot with Y limits (YMIN, YMAX)
  2567.                     and automatic scaling in X.
  2568.  
  2569.  Note: The function FX must be declared EXTERNAL in the Fortran
  2570.  program unit that calls PGFUNY.  It has one argument, the
  2571.  y-coordinate at which the x value is required, e.g.
  2572.    REAL FUNCTION FX(Y)
  2573.    REAL Y
  2574.    FX = .....
  2575.    END
  2576.  
  2577. %PGGRAY
  2578.  gray-scale map of a 2D data array
  2579.      SUBROUTINE PGGRAY (A, IDIM, JDIM, I1, I2, J1, J2,
  2580.     1                   FG, BG, TR)
  2581.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  2582.      REAL    A(IDIM,JDIM), FG, BG, TR(6)
  2583.  
  2584.  Draw gray-scale map of an array in current window. The subsection
  2585.  of the array A defined by indices (I1:I2, J1:J2) is mapped onto
  2586.  the view surface world-coordinate system by the transformation
  2587.  matrix TR. The resulting quadrilateral region is clipped at the edge
  2588.  of the window and shaded with the shade at each point determined
  2589.  by the corresponding array value.  The shade is a number in the
  2590.  range 0 to 1 obtained by linear interpolation between the background
  2591.  level (BG) and the foreground level (FG), i.e.,
  2592.  
  2593.    shade = [A(i,j) - BG] / [FG - BG]
  2594.  
  2595.  The background level BG can be either less than or greater than the
  2596.  foreground level FG.  Points in the array that are outside the range
  2597.  BG to FG are assigned shade 0 or 1 as appropriate.
  2598.  
  2599.  PGGRAY uses two different algorithms, depending how many color
  2600.  indices are available in the color index range specified for images.
  2601.  (This range is set with routine PGSCIR, and the current or default
  2602.  range can be queried by calling routine PGQCIR).
  2603.  
  2604.  If 16 or more color indices are available, PGGRAY first assigns
  2605.  color representations to these color indices to give a linear ramp
  2606.  between the background color (color index 0) and the foreground color
  2607.  (color index 1), and then calls PGIMAG to draw the image using these
  2608.  color indices. In this mode, the shaded region is "opaque": every
  2609.  pixel is assigned a color.
  2610.  
  2611.  If less than 16 color indices are available, PGGRAY uses only
  2612.  color index 1, and uses  a "dithering" algorithm to fill in pixels,
  2613.  with the shade (computed as above) determining the faction of pixels
  2614.  that are filled. In this mode the shaded region is "transparent" and
  2615.  allows previously-drawn graphics to show through.
  2616.  
  2617.  The transformation matrix TR is used to calculate the world
  2618.  coordinates of the center of the "cell" that represents each
  2619.  array element. The world coordinates of the center of the cell
  2620.  corresponding to array element A(I,J) are given by:
  2621.  
  2622.           X = TR(1) + TR(2)*I + TR(3)*J
  2623.           Y = TR(4) + TR(5)*I + TR(6)*J
  2624.  
  2625.  Usually TR(3) and TR(5) are zero -- unless the coordinate
  2626.  transformation involves a rotation or shear.  The corners of the
  2627.  quadrilateral region that is shaded by PGGRAY are given by
  2628.  applying this transformation to (I1-0.5,J1-0.5), (I2+0.5, J2+0.5).
  2629.  
  2630.  Arguments:
  2631.   A      (input)  : the array to be plotted.
  2632.   IDIM   (input)  : the first dimension of array A.
  2633.   JDIM   (input)  : the second dimension of array A.
  2634.   I1, I2 (input)  : the inclusive range of the first index
  2635.                     (I) to be plotted.
  2636.   J1, J2 (input)  : the inclusive range of the second
  2637.                     index (J) to be plotted.
  2638.   FG     (input)  : the array value which is to appear with the
  2639.                     foreground color (corresponding to color index 1).
  2640.   BG     (input)  : the array value which is to appear with the
  2641.                     background color (corresponding to color index 0).
  2642.   TR     (input)  : transformation matrix between array grid and
  2643.                     world coordinates.
  2644.  
  2645. %PGHI2D
  2646.  cross-sections through a 2D data array
  2647.      SUBROUTINE PGHI2D (DATA, NXV, NYV, IX1, IX2, IY1, IY2, X, IOFF,
  2648.     1                   BIAS, CENTER, YLIMS)
  2649.      INTEGER NXV, NYV, IX1, IX2, IY1, IY2
  2650.      REAL    DATA(NXV,NYV)
  2651.      REAL    X(IX2-IX1+1), YLIMS(IX2-IX1+1)
  2652.      INTEGER IOFF
  2653.      REAL    BIAS
  2654.      LOGICAL CENTER
  2655.  
  2656.  Plot a series of cross-sections through a 2D data array.
  2657.  Each cross-section is plotted as a hidden line histogram.  The plot
  2658.  can be slanted to give a pseudo-3D effect - if this is done, the
  2659.  call to PGENV may have to be changed to allow for the increased X
  2660.  range that will be needed.
  2661.  
  2662.  Arguments:
  2663.   DATA   (input)  : the data array to be plotted.
  2664.   NXV    (input)  : the first dimension of DATA.
  2665.   NYV    (input)  : the second dimension of DATA.
  2666.   IX1    (input)
  2667.   IX2    (input)
  2668.   IY1    (input)
  2669.   IY2    (input)  : PGHI2D plots a subset of the input array DATA.
  2670.                     This subset is delimited in the first (x)
  2671.                     dimension by IX1 and IX2 and the 2nd (y) by IY1
  2672.                     and IY2, inclusively. Note: IY2 < IY1 is
  2673.                     permitted, resulting in a plot with the
  2674.                     cross-sections plotted in reverse Y order.
  2675.                     However, IX2 must be => IX1.
  2676.   X      (input)  : the abscissae of the bins to be plotted. That is,
  2677.                     X(1) should be the X value for DATA(IX1,IY1), and
  2678.                     X should have (IX2-IX1+1) elements.  The program
  2679.                     has to assume that the X value for DATA(x,y) is
  2680.                     the same for all y.
  2681.   IOFF   (input)  : an offset in array elements applied to successive
  2682.                     cross-sections to produce a slanted effect.  A
  2683.                     plot with IOFF > 0 slants to the right, one with
  2684.                     IOFF < 0 slants left.
  2685.   BIAS   (input)  : a bias value applied to each successive cross-
  2686.                     section in order to raise it above the previous
  2687.                     cross-section.  This is in the same units as the
  2688.                     data.
  2689.   CENTER (input)  : if .true., the X values denote the center of the
  2690.                     bins; if .false. the X values denote the lower
  2691.                     edges (in X) of the bins.
  2692.   YLIMS  (input)  : workspace.  Should be an array of at least
  2693.                     (IX2-IX1+1) elements.
  2694.  
  2695. %PGHIST
  2696.  histogram of unbinned data
  2697.      SUBROUTINE PGHIST(N, DATA, DATMIN, DATMAX, NBIN, PGFLAG)
  2698.      INTEGER N
  2699.      REAL    DATA(*)
  2700.      REAL    DATMIN, DATMAX
  2701.      INTEGER NBIN, PGFLAG
  2702.  
  2703.  Draw a histogram of N values of a variable in array
  2704.  DATA(1...N) in the range DATMIN to DATMAX using NBIN bins.  Note
  2705.  that array elements which fall exactly on the boundary between
  2706.  two bins will be counted in the higher bin rather than the
  2707.  lower one; and array elements whose value is less than DATMIN or
  2708.  greater than or equal to DATMAX will not be counted at all.
  2709.  
  2710.  Arguments:
  2711.   N      (input)  : the number of data values.
  2712.   DATA   (input)  : the data values. Note: the dimension of array
  2713.                     DATA must be greater than or equal to N. The
  2714.                     first N elements of the array are used.
  2715.   DATMIN (input)  : the minimum data value for the histogram.
  2716.   DATMAX (input)  : the maximum data value for the histogram.
  2717.   NBIN   (input)  : the number of bins to use: the range DATMIN to
  2718.                     DATMAX is divided into NBIN equal bins and
  2719.                     the number of DATA values in each bin is
  2720.                     determined by PGHIST.  NBIN may not exceed 200.
  2721.   PGFLAG (input)  : if PGFLAG = 1, the histogram is plotted in the
  2722.                     current window and viewport; if PGFLAG = 0,
  2723.                     PGENV is called automatically by PGHIST to start
  2724.                     a new plot (the x-limits of the window will be
  2725.                     DATMIN and DATMAX; the y-limits will be chosen
  2726.                     automatically.
  2727.                     IF PGFLAG = 2,3 the histogram will be in the same
  2728.                     window and viewport but with a filled area style.
  2729.                     If pgflag=4,5 as for pgflag = 0,1, but simple
  2730.                     line drawn as for PGBIN
  2731.  
  2732.  
  2733. %PGIDEN
  2734.  write username, date, and time at bottom of plot
  2735.      SUBROUTINE PGIDEN
  2736.  
  2737.  Write username, date, and time at bottom of plot.
  2738.  
  2739.  Arguments: none.
  2740.  
  2741. %PGIMAG
  2742.  color image from a 2D data array
  2743.      SUBROUTINE PGIMAG (A, IDIM, JDIM, I1, I2, J1, J2,
  2744.     1                   A1, A2, TR)
  2745.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  2746.      REAL    A(IDIM,JDIM), A1, A2, TR(6)
  2747.  
  2748.  Draw a color image of an array in current window. The subsection
  2749.  of the array A defined by indices (I1:I2, J1:J2) is mapped onto
  2750.  the view surface world-coordinate system by the transformation
  2751.  matrix TR. The resulting quadrilateral region is clipped at the edge
  2752.  of the window. Each element of the array is represented in the image
  2753.  by a small quadrilateral, which is filled with a color specified by
  2754.  the corresponding array value.
  2755.  
  2756.  The subroutine uses color indices in the range C1 to C2, which can
  2757.  be specified by calling PGSCIR before PGIMAG. The default values
  2758.  for C1 and C2 are device-dependent; these values can be determined by
  2759.  calling PGQCIR. Note that color representations should be assigned to
  2760.  color indices C1 to C2 by calling PGSCR before calling PGIMAG. On some
  2761.  devices (but not all), the color representation can be changed after
  2762.  the call to PGIMAG by calling PGSCR again.
  2763.  
  2764.  Array values in the range A1 to A2 are mapped on to the range of
  2765.  color indices C1 to C2, with array values <= A1 being given color
  2766.  index C1 and values >= A2 being given color index C2. The mapping
  2767.  function for intermediate array values can be specified by
  2768.  calling routine PGSITF before PGIMAG; the default is linear.
  2769.  
  2770.  On devices which have no available color indices (C1 > C2),
  2771.  PGIMAG will return without doing anything. On devices with only
  2772.  one color index (C1=C2), all array values map to the same color
  2773.  which is rather uninteresting. An image is always "opaque",
  2774.  i.e., it obscures all graphical elements previously drawn in
  2775.  the region.
  2776.  
  2777.  The transformation matrix TR is used to calculate the world
  2778.  coordinates of the center of the "cell" that represents each
  2779.  array element. The world coordinates of the center of the cell
  2780.  corresponding to array element A(I,J) are given by:
  2781.  
  2782.           X = TR(1) + TR(2)*I + TR(3)*J
  2783.           Y = TR(4) + TR(5)*I + TR(6)*J
  2784.  
  2785.  Usually TR(3) and TR(5) are zero -- unless the coordinate
  2786.  transformation involves a rotation or shear.  The corners of the
  2787.  quadrilateral region that is shaded by PGIMAG are given by
  2788.  applying this transformation to (I1-0.5,J1-0.5), (I2+0.5, J2+0.5).
  2789.  
  2790.  Arguments:
  2791.   A      (input)  : the array to be plotted.
  2792.   IDIM   (input)  : the first dimension of array A.
  2793.   JDIM   (input)  : the second dimension of array A.
  2794.   I1, I2 (input)  : the inclusive range of the first index
  2795.                     (I) to be plotted.
  2796.   J1, J2 (input)  : the inclusive range of the second
  2797.                     index (J) to be plotted.
  2798.   A1     (input)  : the array value which is to appear with shade C1.
  2799.   A2     (input)  : the array value which is to appear with shade C2.
  2800.   TR     (input)  : transformation matrix between array grid and
  2801.                     world coordinates.
  2802.  
  2803. %PGLAB
  2804.  write labels for x-axis, y-axis, and top of plot
  2805.      SUBROUTINE PGLAB (XLBL, YLBL, TOPLBL)
  2806.      CHARACTER*(*) XLBL, YLBL, TOPLBL
  2807.  
  2808.  Write labels outside the viewport. This routine is a simple
  2809.  interface to PGMTXT, which should be used if PGLAB is inadequate.
  2810.  
  2811.  Arguments:
  2812.   XLBL   (input) : a label for the x-axis (centered below the
  2813.                    viewport).
  2814.   YLBL   (input) : a label for the y-axis (centered to the left
  2815.                    of the viewport, drawn vertically).
  2816.   TOPLBL (input) : a label for the entire plot (centered above the
  2817.                    viewport).
  2818.  
  2819. %PGLABEL
  2820.  non-standard alias for PGLAB
  2821.      SUBROUTINE PGLABEL (XLBL, YLBL, TOPLBL)
  2822.      CHARACTER*(*) XLBL, YLBL, TOPLBL
  2823.  
  2824.  See description of PGLAB.
  2825.  
  2826. %PGLCUR
  2827.  draw a line using the cursor
  2828.      SUBROUTINE PGLCUR (MAXPT, NPT, X, Y)
  2829.      INTEGER MAXPT, NPT
  2830.      REAL    X(*), Y(*)
  2831.  
  2832.  Interactive routine for user to enter a polyline by use of
  2833.  the cursor.  Routine allows user to Add and Delete vertices;
  2834.  vertices are joined by straight-line segments.
  2835.  
  2836.  Arguments:
  2837.   MAXPT  (input)  : maximum number of points that may be accepted.
  2838.   NPT    (in/out) : number of points entered; should be zero on
  2839.                     first call.
  2840.   X      (in/out) : array of x-coordinates (dimension at least MAXPT).
  2841.   Y      (in/out) : array of y-coordinates (dimension at least MAXPT).
  2842.  
  2843.  Notes:
  2844.  
  2845.  (1) On return from the program, cursor points are returned in
  2846.  the order they were entered. Routine may be (re-)called with points
  2847.  already defined in X,Y (# in NPT), and they will be plotted
  2848.  first, before editing.
  2849.  
  2850.  (2) User commands: the user types single-character commands
  2851.  after positioning the cursor: the following are accepted:
  2852.    A (Add)    - add point at current cursor location.
  2853.    D (Delete) - delete last-entered point.
  2854.    X (eXit)   - leave subroutine.
  2855.  
  2856. %PGLDEV
  2857.  list available device types on standard output
  2858.      SUBROUTINE PGLDEV
  2859.  
  2860.  Writes (to standard output) a list of all device types available in
  2861.  the current PGPLOT installation.
  2862.  
  2863.  Arguments: none.
  2864.  
  2865. %PGLEN
  2866.  find length of a string in a variety of units
  2867.      SUBROUTINE PGLEN (UNITS, STRING, XL, YL)
  2868.      REAL XL, YL
  2869.      INTEGER UNITS
  2870.      CHARACTER*(*) STRING
  2871.  
  2872.  Work out length of a string in x and y directions
  2873.  
  2874.  Input
  2875.   UNITS    :  0 => answer in normalized device coordinates
  2876.               1 => answer in inches
  2877.               2 => answer in mm
  2878.               3 => answer in absolute device coordinates (dots)
  2879.               4 => answer in world coordinates
  2880.               5 => answer as a fraction of the current viewport size
  2881.  
  2882.   STRING   :  String of interest
  2883.  Output
  2884.   XL       :  Length of string in x direction
  2885.   YL       :  Length of string in y direction
  2886.  
  2887.  
  2888. %PGLINE
  2889.  draw a polyline (curve defined by line-segments)
  2890.      SUBROUTINE PGLINE (N, XPTS, YPTS)
  2891.      INTEGER  N
  2892.      REAL     XPTS(*), YPTS(*)
  2893.  
  2894.  Primitive routine to draw a Polyline. A polyline is one or more
  2895.  connected straight-line segments.  The polyline is drawn using
  2896.  the current setting of attributes color-index, line-style, and
  2897.  line-width. The polyline is clipped at the edge of the window.
  2898.  
  2899.  Arguments:
  2900.   N      (input)  : number of points defining the line; the line
  2901.                     consists of (N-1) straight-line segments.
  2902.                     N should be greater than 1 (if it is 1 or less,
  2903.                     nothing will be drawn).
  2904.   XPTS   (input)  : world x-coordinates of the points.
  2905.   YPTS   (input)  : world y-coordinates of the points.
  2906.  
  2907.  The dimension of arrays X and Y must be greater than or equal to N.
  2908.  The "pen position" is changed to (X(N),Y(N)) in world coordinates
  2909.  (if N > 1).
  2910.  
  2911. %PGMOVE
  2912.  move pen (change current pen position)
  2913.      SUBROUTINE PGMOVE (X, Y)
  2914.      REAL X, Y
  2915.  
  2916.  Primitive routine to move the "pen" to the point with world
  2917.  coordinates (X,Y). No line is drawn.
  2918.  
  2919.  Arguments:
  2920.   X      (input)  : world x-coordinate of the new pen position.
  2921.   Y      (input)  : world y-coordinate of the new pen position.
  2922.  
  2923. %PGMTEXT
  2924.  non-standard alias for PGMTXT
  2925.      SUBROUTINE PGMTEXT (SIDE, DISP, COORD, FJUST, TEXT)
  2926.      CHARACTER*(*) SIDE, TEXT
  2927.      REAL DISP, COORD, FJUST
  2928.  
  2929.  See description of PGMTXT.
  2930.  
  2931. %PGMTXT
  2932.  write text at position relative to viewport
  2933.      SUBROUTINE PGMTXT (SIDE, DISP, COORD, FJUST, TEXT)
  2934.      CHARACTER*(*) SIDE, TEXT
  2935.      REAL DISP, COORD, FJUST
  2936.  
  2937.  Write text at a position specified relative to the viewport (outside
  2938.  or inside).  This routine is useful for annotating graphs. It is used
  2939.  by routine PGLAB.  The text is written using the current values of
  2940.  attributes color-index, line-width, character-height, and
  2941.  character-font.
  2942.  
  2943.  Arguments:
  2944.   SIDE   (input)  : must include one of the characters 'B', 'L', 'T',
  2945.                     or 'R' signifying the Bottom, Left, Top, or Right
  2946.                     margin of the viewport. If it includes 'LV' or
  2947.                     'RV', the string is written perpendicular to the
  2948.                     frame rather than parallel to it.
  2949.   DISP   (input)  : the displacement of the character string from the
  2950.                     specified edge of the viewport, measured outwards
  2951.                     from the viewport in units of the character
  2952.                     height. Use a negative value to write inside the
  2953.                     viewport, a positive value to write outside.
  2954.   COORD  (input)  : the location of the character string along the
  2955.                     specified edge of the viewport, as a fraction of
  2956.                     the length of the edge.
  2957.   FJUST  (input)  : controls justification of the string parallel to
  2958.                     the specified edge of the viewport. If
  2959.                     FJUST = 0.0, the left-hand end of the string will
  2960.                     be placed at COORD; if JUST = 0.5, the center of
  2961.                     the string will be placed at COORD; if JUST = 1.0,
  2962.                     the right-hand end of the string will be placed at
  2963.                     at COORD. Other values between 0 and 1 give inter-
  2964.                     mediate placing, but they are not very useful.
  2965.   TEXT   (input) :  the text string to be plotted. Trailing spaces are
  2966.                     ignored when justifying the string, but leading
  2967.                     spaces are significant.
  2968.  
  2969.  
  2970. %PGNCUR
  2971.  mark a set of points using the cursor
  2972.      SUBROUTINE PGNCUR (MAXPT, NPT, X, Y, SYMBOL)
  2973.      INTEGER MAXPT, NPT
  2974.      REAL    X(*), Y(*)
  2975.      INTEGER SYMBOL
  2976.  
  2977.  Interactive routine for user to enter data points by use of
  2978.  the cursor.  Routine allows user to Add and Delete points.  The
  2979.  points are returned in order of increasing x-coordinate, not in the
  2980.  order they were entered.
  2981.  
  2982.  Arguments:
  2983.   MAXPT  (input)  : maximum number of points that may be accepted.
  2984.   NPT    (in/out) : number of points entered; should be zero on
  2985.                     first call.
  2986.   X      (in/out) : array of x-coordinates.
  2987.   Y      (in/out) : array of y-coordinates.
  2988.   SYMBOL (input)  : code number of symbol to use for marking
  2989.                     entered points (see PGPT).
  2990.  
  2991.  Note (1): The dimension of arrays X and Y must be greater than or
  2992.  equal to MAXPT.
  2993.  
  2994.  Note (2): On return from the program, cursor points are returned in
  2995.  increasing order of X. Routine may be (re-)called with points
  2996.  already defined in X,Y (number in NPT), and they will be plotted
  2997.  first, before editing.
  2998.  
  2999.  Note (3): User commands: the user types single-character commands
  3000.  after positioning the cursor: the following are accepted:
  3001.  A (Add)    - add point at current cursor location.
  3002.  D (Delete) - delete nearest point to cursor.
  3003.  X (eXit)   - leave subroutine.
  3004.  
  3005. %PGNCURSE
  3006.  non-standard alias for PGNCUR
  3007.      SUBROUTINE PGNCURSE (MAXPT, NPT, X, Y, SYMBOL)
  3008.      INTEGER MAXPT, NPT
  3009.      REAL    X(*), Y(*)
  3010.      INTEGER SYMBOL
  3011.  
  3012.  See description of PGNCUR.
  3013.  
  3014. %PGNUMB
  3015.  convert a number into a plottable character string
  3016.      SUBROUTINE PGNUMB (MM, PP, FORM, STRING, NC)
  3017.      INTEGER MM, PP, FORM
  3018.      CHARACTER*(*) STRING
  3019.      INTEGER NC
  3020.  
  3021.  This routine converts a number into a decimal character
  3022.  representation. To avoid problems of floating-point roundoff, the
  3023.  number must be provided as an integer (MM) multiplied by a power of 10
  3024.  (10**PP).  The output string retains only significant digits of MM,
  3025.  and will be in either integer format (123), decimal format (0.0123),
  3026.  or exponential format (1.23x10**5). Standard escape sequences \u, \d
  3027.  raise the exponent and \x is used for the multiplication sign.
  3028.  This routine is used by PGBOX to create numeric labels for a plot.
  3029.  
  3030.  Formatting rules:
  3031.    (a) Decimal notation (FORM=1):
  3032.        - Trailing zeros to the right of the decimal sign are
  3033.          omitted
  3034.        - The decimal sign is omitted if there are no digits
  3035.          to the right of it
  3036.        - When the decimal sign is placed before the first digit
  3037.          of the number, a zero is placed before the decimal sign
  3038.        - The decimal sign is a period (.)
  3039.        - No spaces are placed between digits (ie digits are not
  3040.          grouped in threes as they should be)
  3041.        - A leading minus (-) is added if the number is negative
  3042.    (b) Exponential notation (FORM=2):
  3043.        - The exponent is adjusted to put just one (non-zero)
  3044.          digit before the decimal sign
  3045.        - The mantissa is formatted as in (a), unless its value is
  3046.          1 in which case it and the multiplication sign are omitted
  3047.        - If the power of 10 is not zero and the mantissa is not
  3048.          zero, an exponent of the form \x10\u[-]nnn is appended,
  3049.          where \x is a multiplication sign (cross), \u is an escape
  3050.          sequence to raise the exponent, and as many digits nnn
  3051.          are used as needed
  3052.    (c) Automatic choice (FORM=0):
  3053.          Decimal notation is used if the absolute value of the
  3054.          number is less than 10000 or greater than or equal to
  3055.          0.01. Otherwise exponential notation is used.
  3056.  
  3057.  Arguments:
  3058.   MM     (input)
  3059.   PP     (input)  : the value to be formatted is MM*10**PP.
  3060.   FORM   (input)  : controls how the number is formatted:
  3061.                     FORM = 0 -- use either decimal or exponential
  3062.                     FORM = 1 -- use decimal notation
  3063.                     FORM = 2 -- use exponential notation
  3064.   STRING (output) : the formatted character string, left justified.
  3065.                     If the length of STRING is insufficient, a single
  3066.                     asterisk is returned, and NC=1.
  3067.   NC     (output) : the number of characters used in STRING:
  3068.                     the string to be printed is STRING(1:NC).
  3069.  
  3070. %PGOLIN
  3071.  mark a set of points using the cursor
  3072.      SUBROUTINE PGOLIN (MAXPT, NPT, X, Y, SYMBOL)
  3073.      INTEGER MAXPT, NPT
  3074.      REAL    X(*), Y(*)
  3075.      INTEGER SYMBOL
  3076.  
  3077.  Interactive routine for user to enter data points by use of
  3078.  the cursor.  Routine allows user to Add and Delete points.  The
  3079.  points are returned in the order that they were entered (unlike
  3080.  PGNCUR).
  3081.  
  3082.  Arguments:
  3083.   MAXPT  (input)  : maximum number of points that may be accepted.
  3084.   NPT    (in/out) : number of points entered; should be zero on
  3085.                     first call.
  3086.   X      (in/out) : array of x-coordinates.
  3087.   Y      (in/out) : array of y-coordinates.
  3088.   SYMBOL (input)  : code number of symbol to use for marking
  3089.                     entered points (see PGPT).
  3090.  
  3091.  Note (1): The dimension of arrays X and Y must be greater than or
  3092.  equal to MAXPT.
  3093.  
  3094.  Note (2): On return from the program, cursor points are returned in
  3095.  the order they were entered. Routine may be (re-)called with points
  3096.  already defined in X,Y (number in NPT), and they will be plotted
  3097.  first, before editing.
  3098.  
  3099.  Note (3): User commands: the user types single-character commands
  3100.  after positioning the cursor: the following are accepted:
  3101.  A (Add)    - add point at current cursor location.
  3102.  D (Delete) - delete the last point entered.
  3103.  X (eXit)   - leave subroutine.
  3104.  
  3105. %PGOPEN
  3106.  open a graphics device
  3107.      INTEGER FUNCTION PGOPEN (DEVICE)
  3108.      CHARACTER*(*) DEVICE
  3109.  
  3110.  Open a graphics device for PGPLOT output. If the device is
  3111.  opened successfully, it becomes the selected device to which
  3112.  graphics output is directed until another device is selected
  3113.  with PGSLCT or the device is closed with PGCLOS.
  3114.  
  3115.  The value returned by PGOPEN should be tested to ensure that
  3116.  the device was opened successfully, e.g.,
  3117.  
  3118.        ISTAT = PGOPEN('plot.ps/PS')
  3119.        IF (ISTAT .LE. 0 ) STOP
  3120.  
  3121.  Note that PGOPEN must be declared INTEGER in the calling program.
  3122.  
  3123.  The DEVICE argument is a character constant or variable; its value
  3124.  should be one of the following:
  3125.  
  3126.  (1) A complete device specification of the form 'device/type' or
  3127.      'file/type', where 'type' is one of the allowed PGPLOT device
  3128.      types (installation-dependent) and 'device' or 'file' is the
  3129.      name of a graphics device or disk file appropriate for this type.
  3130.      The 'device' or 'file' may contain '/' characters; the final
  3131.      '/' delimits the 'type'. If necessary to avoid ambiguity,
  3132.      the 'device' part of the string may be enclosed in double
  3133.      quotation marks.
  3134.  (2) A device specification of the form '/type', where 'type' is one
  3135.      of the allowed PGPLOT device types. PGPLOT supplies a default
  3136.      file or device name appropriate for this device type.
  3137.  (3) A device specification with '/type' omitted; in this case
  3138.      the type is taken from the environment variable PGPLOT_TYPE,
  3139.      if defined (e.g., setenv PGPLOT_TYPE PS). Because of possible
  3140.      confusion with '/' in file-names, omitting the device type
  3141.      in this way is not recommended.
  3142.  (4) A blank string (' '); in this case, PGOPEN will use the value
  3143.      of environment variable PGPLOT_DEV as the device specification,
  3144.      or '/NULL' if the environment variable is undefined.
  3145.  (5) A single question mark, with optional trailing spaces ('?'); in
  3146.      this case, PGPLOT will prompt the user to supply the device
  3147.      specification, with a prompt string of the form
  3148.          'Graphics device/type (? to see list, default XXX):'
  3149.      where 'XXX' is the default (value of environment variable
  3150.      PGPLOT_DEV).
  3151.  (6) A non-blank string in which the first character is a question
  3152.      mark (e.g., '?Device: '); in this case, PGPLOT will prompt the
  3153.      user to supply the device specification, using the supplied
  3154.      string as the prompt (without the leading question mark but
  3155.      including any trailing spaces).
  3156.  
  3157.  In cases (5) and (6), the device specification is read from the
  3158.  standard input. The user should respond to the prompt with a device
  3159.  specification of the form (1), (2), or (3). If the user types a
  3160.  question-mark in response to the prompt, a list of available device
  3161.  types is displayed and the prompt is re-issued. If the user supplies
  3162.  an invalid device specification, the prompt is re-issued. If the user
  3163.  responds with an end-of-file character, e.g., ctrl-D in UNIX, program
  3164.  execution is aborted; this  avoids the possibility of an infinite
  3165.  prompting loop.  A programmer should avoid use of PGPLOT-prompting
  3166.  if this behavior is not desirable.
  3167.  
  3168.  The device type is case-insensitive (e.g., '/ps' and '/PS' are
  3169.  equivalent). The device or file name may be case-sensitive in some
  3170.  operating systems.
  3171.  
  3172.  Examples of valid DEVICE arguments:
  3173.  
  3174.  (1)  'plot.ps/ps', 'dir/plot.ps/ps', '"dir/plot.ps"/ps',
  3175.       'user:[tjp.plots]plot.ps/PS'
  3176.  (2)  '/ps'      (PGPLOT interprets this as 'pgplot.ps/ps')
  3177.  (3)  'plot.ps'  (if PGPLOT_TYPE is defined as 'ps', PGPLOT
  3178.                   interprets this as 'plot.ps/ps')
  3179.  (4)  '   '      (if PGPLOT_DEV is defined)
  3180.  (5)  '?  '
  3181.  (6)  '?Device specification for PGPLOT: '
  3182.  
  3183.  [This routine was added to PGPLOT in Version 5.1.0. Older programs
  3184.  use PGBEG instead.]
  3185.  
  3186.  Returns:
  3187.   PGOPEN          : returns either a positive value, the
  3188.                     identifier of the graphics device for use with
  3189.                     PGSLCT, or a 0 or negative value indicating an
  3190.                     error. In the event of error a message is
  3191.                     written on the standard error unit.
  3192.  Arguments:
  3193.   DEVICE  (input) : the 'device specification' for the plot device
  3194.                     (see above).
  3195.  
  3196. %PGPAGE
  3197.  advance to new page
  3198.      SUBROUTINE PGPAGE
  3199.  
  3200.  Advance plotter to a new page or panel, clearing the screen if
  3201.  necessary. If the "prompt state" is ON (see PGASK), confirmation is
  3202.  requested from the user before clearing the screen. If the view
  3203.  surface has been subdivided into panels with PGBEG or PGSUBP, then
  3204.  PGPAGE advances to the next panel, and if the current panel is the
  3205.  last on the page, PGPAGE clears the screen or starts a new sheet of
  3206.  paper.  PGPAGE does not change the PGPLOT window or the viewport
  3207.  (in normalized device coordinates); but note that if the size of the
  3208.  view-surface is changed externally (e.g., by a workstation window
  3209.  manager) the size of the viewport is changed in proportion.
  3210.  
  3211.  Arguments: none
  3212.  
  3213. %PGPANL
  3214.  switch to a different panel on the view surface
  3215.      SUBROUTINE PGPANL(IX, IY)
  3216.      INTEGER IX, IY
  3217.  
  3218.  Start plotting in a different panel. If the view surface has been
  3219.  divided into panels by PGBEG or PGSUBP, this routine can be used to
  3220.  move to a different panel. Note that PGPLOT does not remember what
  3221.  viewport and window were in use in each panel; these should be reset
  3222.  if necessary after calling PGPANL. Nor does PGPLOT clear the panel:
  3223.  call PGERAS after calling PGPANL to do this.
  3224.  
  3225.  Arguments:
  3226.   IX     (input)  : the horizontal index of the panel (in the range
  3227.                     1 <= IX <= number of panels in horizontal
  3228.                     direction).
  3229.   IY     (input)  : the vertical index of the panel (in the range
  3230.                     1 <= IY <= number of panels in horizontal
  3231.                     direction).
  3232.  
  3233. %PGPAP
  3234.  change the size of the view surface
  3235.      SUBROUTINE PGPAP (WIDTH, ASPECT)
  3236.      REAL WIDTH, ASPECT
  3237.  
  3238.  This routine changes the size of the view surface ("paper size") to a
  3239.  specified width and aspect ratio (height/width), in so far as this is
  3240.  possible on the specific device. It is always possible to obtain a
  3241.  view surface smaller than the default size; on some devices (e.g.,
  3242.  printers that print on roll or fan-feed paper) it is possible to
  3243.  obtain a view surface larger than the default.
  3244.  
  3245.  This routine should be called either immediately after PGBEG or
  3246.  immediately before PGPAGE. The new size applies to all subsequent
  3247.  images until the next call to PGPAP.
  3248.  
  3249.  Arguments:
  3250.   WIDTH  (input)  : the requested width of the view surface in inches;
  3251.                     if WIDTH=0.0, PGPAP will obtain the largest view
  3252.                     surface available consistent with argument ASPECT.
  3253.                     (1 inch = 25.4 mm.)
  3254.   ASPECT (input)  : the aspect ratio (height/width) of the view
  3255.                     surface; e.g., ASPECT=1.0 gives a square view
  3256.                     surface, ASPECT=0.618 gives a horizontal
  3257.                     rectangle, ASPECT=1.618 gives a vertical rectangle.
  3258.  
  3259. %PGPAPER
  3260.  non-standard alias for PGPAP
  3261.      SUBROUTINE PGPAPER (WIDTH, ASPECT)
  3262.      REAL WIDTH, ASPECT
  3263.  
  3264.  See description of PGPAP.
  3265.  
  3266. %PGPIXL
  3267.  draw pixels
  3268.      SUBROUTINE PGPIXL (IA, IDIM, JDIM, I1, I2, J1, J2,
  3269.     1                   X1, X2, Y1, Y2)
  3270.      INTEGER IDIM, JDIM, I1, I2, J1, J2
  3271.      INTEGER IA(IDIM,JDIM)
  3272.      REAL    X1, X2, Y1, Y2
  3273.  
  3274.  Draw lots of solid-filled (tiny) rectangles aligned with the
  3275.  coordinate axes. Best performance is achieved when output is
  3276.  directed to a pixel-oriented device and the rectangles coincide
  3277.  with the pixels on the device. In other cases, pixel output is
  3278.  emulated.
  3279.  
  3280.  The subsection of the array IA defined by indices (I1:I2, J1:J2)
  3281.  is mapped onto world-coordinate rectangle defined by X1, X2, Y1
  3282.  and Y2. This rectangle is divided into (I2 - I1 + 1) * (J2 - J1 + 1)
  3283.  small rectangles. Each of these small rectangles is solid-filled
  3284.  with the color index specified by the corresponding element of
  3285.  IA.
  3286.  
  3287.  On most devices, the output region is "opaque", i.e., it obscures
  3288.  all graphical elements previously drawn in the region. But on
  3289.  devices that do not have erase capability, the background shade
  3290.  is "transparent" and allows previously-drawn graphics to show
  3291.  through.
  3292.  
  3293.  Arguments:
  3294.   IA     (input)  : the array to be plotted.
  3295.   IDIM   (input)  : the first dimension of array A.
  3296.   JDIM   (input)  : the second dimension of array A.
  3297.   I1, I2 (input)  : the inclusive range of the first index
  3298.                     (I) to be plotted.
  3299.   J1, J2 (input)  : the inclusive range of the second
  3300.                     index (J) to be plotted.
  3301.   X1, Y1 (input)  : world coordinates of one corner of the output
  3302.                     region
  3303.   X2, Y2 (input)  : world coordinates of the opposite corner of the
  3304.                     output region
  3305.  
  3306. %PGPNTS
  3307.  draw several graph markers, not all the same
  3308.      SUBROUTINE PGPNTS (N, X, Y, SYMBOL, NS)
  3309.      INTEGER N, NS
  3310.      REAL X(*), Y(*)
  3311.      INTEGER SYMBOL(*)
  3312.  
  3313.  Draw Graph Markers. Unlike PGPT, this routine can draw a different
  3314.  symbol at each point. The markers are drawn using the current values
  3315.  of attributes color-index, line-width, and character-height
  3316.  (character-font applies if the symbol number is >31).  If the point
  3317.  to be marked lies outside the window, no marker is drawn.  The "pen
  3318.  position" is changed to (XPTS(N),YPTS(N)) in world coordinates
  3319.  (if N > 0).
  3320.  
  3321.  Arguments:
  3322.   N      (input)  : number of points to mark.
  3323.   X      (input)  : world x-coordinate of the points.
  3324.   Y      (input)  : world y-coordinate of the points.
  3325.   SYMBOL (input)  : code number of the symbol to be plotted at each
  3326.                     point (see PGPT).
  3327.   NS     (input)  : number of values in the SYMBOL array.  If NS <= N,
  3328.                     then the first NS points are drawn using the value
  3329.                     of SYMBOL(I) at (X(I), Y(I)) and SYMBOL(1) for all
  3330.                     the values of (X(I), Y(I)) where I > NS.
  3331.  
  3332.  Note: the dimension of arrays X and Y must be greater than or equal
  3333.  to N and the dimension of the array SYMBOL must be greater than or
  3334.  equal to NS.  If N is 1, X and Y may be scalars (constants or
  3335.  variables).  If NS is 1, then SYMBOL may be a scalar.  If N is
  3336.  less than 1, nothing is drawn.
  3337.  
  3338. %PGPOINT
  3339.  non-standard alias for PGPT
  3340.      SUBROUTINE PGPOINT (N, XPTS, YPTS, SYMBOL)
  3341.      INTEGER N
  3342.      REAL XPTS(*), YPTS(*)
  3343.      INTEGER SYMBOL
  3344.  
  3345.  See description of PGPT.
  3346.  
  3347. %PGPOLY
  3348.  draw a polygon, using fill-area attributes
  3349.      SUBROUTINE PGPOLY (N, XPTS, YPTS)
  3350.      INTEGER N
  3351.      REAL XPTS(*), YPTS(*)
  3352.  
  3353.  Fill-area primitive routine: shade the interior of a closed
  3354.  polygon in the current window.  The action of this routine depends
  3355.  on the setting of the Fill-Area Style attribute (see PGSFS).
  3356.  The polygon is clipped at the edge of the
  3357.  window. The pen position is changed to (XPTS(1),YPTS(1)) in world
  3358.  coordinates (if N > 1).  If the polygon is not convex, a point is
  3359.  assumed to lie inside the polygon if a straight line drawn to
  3360.  infinity intersects and odd number of the polygon's edges.
  3361.  
  3362.  Arguments:
  3363.   N      (input)  : number of points defining the polygon; the
  3364.                     line consists of N straight-line segments,
  3365.                     joining points 1 to 2, 2 to 3,... N-1 to N, N to 1.
  3366.                     N should be greater than 2 (if it is 2 or less,
  3367.                     nothing will be drawn).
  3368.   XPTS   (input)  : world x-coordinates of the vertices.
  3369.   YPTS   (input)  : world y-coordinates of the vertices.
  3370.                     Note: the dimension of arrays XPTS and YPTS must be
  3371.                     greater than or equal to N.
  3372.  
  3373. %PGPT
  3374.  draw several graph markers
  3375.      SUBROUTINE PGPT (N, XPTS, YPTS, SYMBOL)
  3376.      INTEGER N
  3377.      REAL XPTS(*), YPTS(*)
  3378.      INTEGER SYMBOL
  3379.  
  3380.  Primitive routine to draw Graph Markers (polymarker). The markers
  3381.  are drawn using the current values of attributes color-index,
  3382.  line-width, and character-height (character-font applies if the symbol
  3383.  number is >31).  If the point to be marked lies outside the window,
  3384.  no marker is drawn.  The "pen position" is changed to
  3385.  (XPTS(N),YPTS(N)) in world coordinates (if N > 0).
  3386.  
  3387.  Arguments:
  3388.   N      (input)  : number of points to mark.
  3389.   XPTS   (input)  : world x-coordinates of the points.
  3390.   YPTS   (input)  : world y-coordinates of the points.
  3391.   SYMBOL (input)  : code number of the symbol to be drawn at each
  3392.                     point:
  3393.                     -1, -2  : a single dot (diameter = current
  3394.                               line width).
  3395.                     -3..-31 : a regular polygon with ABS(SYMBOL)
  3396.                               edges (style set by current fill style).
  3397.                     0..31   : standard marker symbols.
  3398.                     32..127 : ASCII characters (in current font).
  3399.                               e.g. to use letter F as a marker, let
  3400.                               SYMBOL = ICHAR('F').
  3401.                     > 127  :  a Hershey symbol number.
  3402.  
  3403.  Note: the dimension of arrays X and Y must be greater than or equal
  3404.  to N. If N is 1, X and Y may be scalars (constants or variables). If
  3405.  N is less than 1, nothing is drawn.
  3406.  
  3407. %PGPT1
  3408.  draw one graph marker
  3409.      SUBROUTINE PGPT1 (XPT, YPT, SYMBOL)
  3410.      REAL XPT, YPT
  3411.      INTEGER SYMBOL
  3412.  
  3413.  Primitive routine to draw a single Graph Marker at a specified point.
  3414.  The marker is drawn using the current values of attributes
  3415.  color-index, line-width, and character-height (character-font applies
  3416.  if the symbol number is >31).  If the point to be marked lies outside
  3417.  the window, no marker is drawn.  The "pen position" is changed to
  3418.  (XPT,YPT) in world coordinates.
  3419.  
  3420.  To draw several markers with coordinates specified by X and Y
  3421.  arrays, use routine PGPT.
  3422.  
  3423.  Arguments:
  3424.   XPT    (input)  : world x-coordinate of the point.
  3425.   YPT    (input)  : world y-coordinate of the point.
  3426.   SYMBOL (input)  : code number of the symbol to be drawn:
  3427.                     -1, -2  : a single dot (diameter = current
  3428.                               line width).
  3429.                     -3..-31 : a regular polygon with ABS(SYMBOL)
  3430.                               edges (style set by current fill style).
  3431.                     0..31   : standard marker symbols.
  3432.                     32..127 : ASCII characters (in current font).
  3433.                               e.g. to use letter F as a marker, let
  3434.                               SYMBOL = ICHAR('F').
  3435.                     > 127  :  a Hershey symbol number.
  3436.  
  3437. %PGPTEXT
  3438.  non-standard alias for PGPTXT
  3439.      SUBROUTINE PGPTEXT (X, Y, ANGLE, FJUST, TEXT)
  3440.      REAL X, Y, ANGLE, FJUST
  3441.      CHARACTER*(*) TEXT
  3442.  
  3443.  See description of PGPTXT.
  3444.  
  3445. %PGPTXT
  3446.  write text at arbitrary position and angle
  3447.      SUBROUTINE PGPTXT (X, Y, ANGLE, FJUST, TEXT)
  3448.      REAL X, Y, ANGLE, FJUST
  3449.      CHARACTER*(*) TEXT
  3450.  
  3451.  Primitive routine for drawing text. The text may be drawn at any
  3452.  angle with the horizontal, and may be centered or left- or right-
  3453.  justified at a specified position.  Routine PGTEXT provides a
  3454.  simple interface to PGPTXT for horizontal strings. Text is drawn
  3455.  using the current values of attributes color-index, line-width,
  3456.  character-height, and character-font.  Text is NOT subject to
  3457.  clipping at the edge of the window.
  3458.  
  3459.  Arguments:
  3460.   X      (input)  : world x-coordinate.
  3461.   Y      (input)  : world y-coordinate. The string is drawn with the
  3462.                     baseline of all the characters passing through
  3463.                     point (X,Y); the positioning of the string along
  3464.                     this line is controlled by argument FJUST.
  3465.   ANGLE  (input)  : angle, in degrees, that the baseline is to make
  3466.                     with the horizontal, increasing counter-clockwise
  3467.                     (0.0 is horizontal).
  3468.   FJUST  (input)  : controls horizontal justification of the string.
  3469.                     If FJUST = 0.0, the string will be left-justified
  3470.                     at the point (X,Y); if FJUST = 0.5, it will be
  3471.                     centered, and if FJUST = 1.0, it will be right
  3472.                     justified. [Other values of FJUST give other
  3473.                     justifications.]
  3474.   TEXT   (input)  : the character string to be plotted.
  3475.  
  3476. %PGQAH
  3477.  inquire arrow-head style
  3478.      SUBROUTINE PGQAH (FS, ANGLE, BARB)
  3479.      INTEGER  FS
  3480.      REAL ANGLE, BARB
  3481.  
  3482.  Query the style to be used for arrowheads drawn with routine PGARRO.
  3483.  
  3484.  Argument:
  3485.   FS     (output) : FS = 1 => filled; FS = 2 => outline.
  3486.   ANGLE  (output) : the acute angle of the arrow point, in degrees.
  3487.   BARB   (output) : the fraction of the triangular arrow-head that
  3488.                     is cut away from the back.
  3489.  
  3490. %PGQCF
  3491.  inquire character font
  3492.      SUBROUTINE PGQCF (FONT)
  3493.      INTEGER  FONT
  3494.  
  3495.  Query the current Character Font (set by routine PGSCF).
  3496.  
  3497.  Argument:
  3498.   FONT   (output)   : the current font number (in range 1-4).
  3499.  
  3500. %PGQCH
  3501.  inquire character height
  3502.      SUBROUTINE PGQCH (SIZE)
  3503.      REAL SIZE
  3504.  
  3505.  Query the Character Size attribute (set by routine PGSCH).
  3506.  
  3507.  Argument:
  3508.   SIZE   (output) : current character size (dimensionless multiple of
  3509.                     the default size).
  3510.  
  3511. %PGQCI
  3512.  inquire color index
  3513.      SUBROUTINE PGQCI (CI)
  3514.      INTEGER  CI
  3515.  
  3516.  Query the Color Index attribute (set by routine PGSCI).
  3517.  
  3518.  Argument:
  3519.   CI     (output) : the current color index (in range 0-max). This is
  3520.                     the color index actually in use, and may differ
  3521.                     from the color index last requested by PGSCI if
  3522.                     that index is not available on the output device.
  3523.  
  3524. %PGQCIR
  3525.  inquire color index range
  3526.      SUBROUTINE PGQCIR(ICILO, ICIHI)
  3527.      INTEGER   ICILO, ICIHI
  3528.  
  3529.  Query the color index range to be used for producing images with
  3530.  PGGRAY or PGIMAG, as set by routine PGSCIR or by device default.
  3531.  
  3532.  Arguments:
  3533.   ICILO  (output) : the lowest color index to use for images
  3534.   ICIHI  (output) : the highest color index to use for images
  3535.  
  3536. %PGQCLP
  3537.  inquire clipping status
  3538.      SUBROUTINE PGQCLP(STATE)
  3539.      INTEGER  STATE
  3540.  
  3541.  Query the current clipping status (set by routine PGSCLP).
  3542.  
  3543.  Argument:
  3544.   STATE  (output) : receives the clipping status (0 => disabled,
  3545.                     1 => enabled).
  3546.  
  3547. %PGQCOL
  3548.  inquire color capability
  3549.      SUBROUTINE PGQCOL (CI1, CI2)
  3550.      INTEGER  CI1, CI2
  3551.  
  3552.  Query the range of color indices available on the current device.
  3553.  
  3554.  Argument:
  3555.   CI1    (output) : the minimum available color index. This will be
  3556.                     either 0 if the device can write in the
  3557.                     background color, or 1 if not.
  3558.   CI2    (output) : the maximum available color index. This will be
  3559.                     1 if the device has no color capability, or a
  3560.                     larger number (e.g., 3, 7, 15, 255).
  3561.  
  3562. %PGQCR
  3563.  -- inquire color representation
  3564.      SUBROUTINE PGQCR (CI, CR, CG, CB)
  3565.      INTEGER CI
  3566.      REAL    CR, CG, CB
  3567.  
  3568.  Query the RGB colors associated with a color index.
  3569.  
  3570.  Arguments:
  3571.   CI  (input)  : color index
  3572.   CR  (output) : red, green and blue intensities
  3573.   CG  (output)   in the range 0.0 to 1.0
  3574.   CB  (output)
  3575.  
  3576. %PGQCS
  3577.  -- inquire character height in a variety of units
  3578.      SUBROUTINE PGQCS(UNITS, XCH, YCH)
  3579.      INTEGER UNITS
  3580.      REAL XCH, YCH
  3581.  
  3582.  Return the current PGPLOT character height in a variety of units.
  3583.  This routine provides facilities that are not available via PGQCH.
  3584.  Use PGQCS if the character height is required in units other than
  3585.  those used in PGSCH.
  3586.  
  3587.  The PGPLOT "character height" is a dimension that scales with the
  3588.  size of the view surface and with the scale-factor specified with
  3589.  routine PGSCH. The default value is 1/40th of the height or width
  3590.  of the view surface (whichever is less); this value is then
  3591.  multiplied by the scale-factor supplied with PGSCH. Note that it
  3592.  is a nominal height only; the actual character size depends on the
  3593.  font and is usually somewhat smaller.
  3594.  
  3595.  Arguments:
  3596.   UNITS  (input)  : Used to specify the units of the output value:
  3597.                     UNITS = 0 : normalized device coordinates
  3598.                     UNITS = 1 : inches
  3599.                     UNITS = 2 : millimeters
  3600.                     UNITS = 3 : pixels
  3601.                     UNITS = 4 : world coordinates
  3602.                     Other values give an error message, and are
  3603.                     treated as 0.
  3604.   XCH    (output) : The character height for text written with a
  3605.                     vertical baseline.
  3606.   YCH    (output) : The character height for text written with
  3607.                     a horizontal baseline (the usual case).
  3608.  
  3609.  The character height is returned in both XCH and YCH.
  3610.  
  3611.  If UNITS=1 or UNITS=2, XCH and YCH both receive the same value.
  3612.  
  3613.  If UNITS=3, XCH receives the height in horizontal pixel units, and YCH
  3614.  receives the height in vertical pixel units; on devices for which the
  3615.  pixels are not square, XCH and YCH will be different.
  3616.  
  3617.  If UNITS=4, XCH receives the height in horizontal world coordinates
  3618.  (as used for the x-axis), and YCH receives the height in vertical
  3619.  world coordinates (as used for the y-axis). Unless special care has
  3620.  been taken to achive equal world-coordinate scales on both axes, the
  3621.  values of XCH and YCH will be different.
  3622.  
  3623.  If UNITS=0, XCH receives the character height as a fraction of the
  3624.  horizontal dimension of the view surface, and YCH receives the
  3625.  character height as a fraction of the vertical dimension of the view
  3626.  surface.
  3627.  
  3628. %PGQDT
  3629.  inquire name of nth available device type
  3630.      SUBROUTINE PGQDT(N, TYPE, TLEN, DESCR, DLEN, INTER)
  3631.      INTEGER N
  3632.      CHARACTER*(*) TYPE, DESCR
  3633.      INTEGER TLEN, DLEN, INTER
  3634.  
  3635.  Return the name of the Nth available device type as a character
  3636.  string. The number of available types can be determined by calling
  3637.  PGQNDT. If the value of N supplied is outside the range from 1 to
  3638.  the number of available types, the routine returns DLEN=TLEN=0.
  3639.  
  3640.  Arguments:
  3641.   N      (input)  : the number of the device type (1..maximum).
  3642.   TYPE   (output) : receives the character device-type code of the
  3643.                     Nth device type. The argument supplied should be
  3644.                     large enough for at least 8 characters. The first
  3645.                     character in the string is a '/' character.
  3646.   TLEN   (output) : receives the number of characters in TYPE,
  3647.                     excluding trailing blanks.
  3648.   DESCR  (output) : receives a description of the device type. The
  3649.                     argument supplied should be large enough for at
  3650.                     least 64 characters.
  3651.   DLEN   (output) : receives the number of characters in DESCR,
  3652.                     excluding trailing blanks.
  3653.   INTER  (output) : receives 1 if the device type is an interactive
  3654.                     one, 0 otherwise.
  3655.  
  3656. %PGQFS
  3657.  inquire fill-area style
  3658.      SUBROUTINE PGQFS (FS)
  3659.      INTEGER  FS
  3660.  
  3661.  Query the current Fill-Area Style attribute (set by routine
  3662.  PGSFS).
  3663.  
  3664.  Argument:
  3665.   FS     (output) : the current fill-area style:
  3666.                       FS = 1 => solid (default)
  3667.                       FS = 2 => outline
  3668.                       FS = 3 => hatched
  3669.                       FS = 4 => cross-hatched
  3670.  
  3671. %PGQHS
  3672.  inquire hatching style
  3673.      SUBROUTINE PGQHS (ANGLE, SEPN, PHASE)
  3674.      REAL ANGLE, SEPN, PHASE
  3675.  
  3676.  Query the style to be used hatching (fill area with fill-style 3).
  3677.  
  3678.  Arguments:
  3679.   ANGLE  (output) : the angle the hatch lines make with the
  3680.                     horizontal, in degrees, increasing
  3681.                     counterclockwise (this is an angle on the
  3682.                     view surface, not in world-coordinate space).
  3683.   SEPN   (output) : the spacing of the hatch lines. The unit spacing
  3684.                     is 1 percent of the smaller of the height or
  3685.                     width of the view surface.
  3686.   PHASE  (output) : a real number between 0 and 1; the hatch lines
  3687.                     are displaced by this fraction of SEPN from a
  3688.                     fixed reference.  Adjacent regions hatched with the
  3689.                     same PHASE have contiguous hatch lines.
  3690.  
  3691. %PGQID
  3692.  inquire current device identifier
  3693.      SUBROUTINE PGQID (ID)
  3694.      INTEGER  ID
  3695.  
  3696.  This subroutine returns the identifier of the currently
  3697.  selected device, or 0 if no device is selected.  The identifier is
  3698.  assigned when PGOPEN is called to open the device, and may be used
  3699.  as an argument to PGSLCT.  Each open device has a different
  3700.  identifier.
  3701.  
  3702.  [This routine was added to PGPLOT in Version 5.1.0.]
  3703.  
  3704.  Argument:
  3705.   ID     (output) : the identifier of the current device, or 0 if
  3706.                     no device is currently selected.
  3707.  
  3708. %PGQINF
  3709.  inquire PGPLOT general information
  3710.      SUBROUTINE PGQINF (ITEM, VALUE, LENGTH)
  3711.      CHARACTER*(*) ITEM, VALUE
  3712.      INTEGER LENGTH
  3713.  
  3714.  This routine can be used to obtain miscellaneous information about
  3715.  the PGPLOT environment. Input is a character string defining the
  3716.  information required, and output is a character string containing the
  3717.  requested information.
  3718.  
  3719.  The following item codes are accepted (note that the strings must
  3720.  match exactly, except for case, but only the first 8 characters are
  3721.  significant). For items marked *, PGPLOT must be in the OPEN state
  3722.  for the inquiry to succeed. If the inquiry is unsuccessful, either
  3723.  because the item code is not recognized or because the information
  3724.  is not available, a question mark ('?') is returned.
  3725.  
  3726.    'VERSION'     - version of PGPLOT software in use.
  3727.    'STATE'       - status of PGPLOT ('OPEN' if a graphics device
  3728.                    is open for output, 'CLOSED' otherwise).
  3729.    'USER'        - the username associated with the calling program.
  3730.    'NOW'         - current date and time (e.g., '17-FEB-1986 10:04').
  3731.    'DEVICE'    * - current PGPLOT device or file.
  3732.    'FILE'      * - current PGPLOT device or file.
  3733.    'TYPE'      * - device-type of the current PGPLOT device.
  3734.    'DEV/TYPE'  * - current PGPLOT device and type, in a form which
  3735.                    is acceptable as an argument for PGBEG.
  3736.    'HARDCOPY'  * - is the current device a hardcopy device? ('YES' or
  3737.                    'NO').
  3738.    'TERMINAL'  * - is the current device the user's interactive
  3739.                    terminal? ('YES' or 'NO').
  3740.    'CURSOR'    * - does the current device have a graphics cursor?
  3741.                    ('YES' or 'NO').
  3742.    'SCROLL'    * - does current device have rectangle-scroll
  3743.                    capability ('YES' or 'NO'); see PGSCRL.
  3744.  
  3745.  Arguments:
  3746.   ITEM  (input)  : character string defining the information to
  3747.                    be returned; see above for a list of possible
  3748.                    values.
  3749.   VALUE (output) : returns a character-string containing the
  3750.                    requested information, truncated to the length
  3751.                    of the supplied string or padded on the right with
  3752.                    spaces if necessary.
  3753.   LENGTH (output): the number of characters returned in VALUE
  3754.                    (excluding trailing blanks).
  3755.  
  3756. %PGQITF
  3757.  inquire image transfer function
  3758.      SUBROUTINE PGQITF (ITF)
  3759.      INTEGER  ITF
  3760.  
  3761.  Return the Image Transfer Function as set by default or by a previous
  3762.  call to PGSITF. The Image Transfer Function is used by routines
  3763.  PGIMAG, PGGRAY, and PGWEDG.
  3764.  
  3765.  Argument:
  3766.   ITF    (output) : type of transfer function (see PGSITF)
  3767.  
  3768. %PGQLS
  3769.  inquire line style
  3770.      SUBROUTINE PGQLS (LS)
  3771.      INTEGER  LS
  3772.  
  3773.  Query the current Line Style attribute (set by routine PGSLS).
  3774.  
  3775.  Argument:
  3776.   LS     (output) : the current line-style attribute (in range 1-5).
  3777.  
  3778. %PGQLW
  3779.  inquire line width
  3780.      SUBROUTINE PGQLW (LW)
  3781.      INTEGER  LW
  3782.  
  3783.  Query the current Line-Width attribute (set by routine PGSLW).
  3784.  
  3785.  Argument:
  3786.   LW     (output)  : the line-width (in range 1-201).
  3787.  
  3788. %PGQNDT
  3789.  inquire number of available device types
  3790.      SUBROUTINE PGQNDT(N)
  3791.      INTEGER N
  3792.  
  3793.  Return the number of available device types. This routine is
  3794.  usually used in conjunction with PGQDT to get a list of the
  3795.  available device types.
  3796.  
  3797.  Arguments:
  3798.   N      (output) : the number of available device types.
  3799.  
  3800. %PGQPOS
  3801.  inquire current pen position
  3802.      SUBROUTINE PGQPOS (X, Y)
  3803.      REAL X, Y
  3804.  
  3805.  Query the current "pen" position in world C coordinates (X,Y).
  3806.  
  3807.  Arguments:
  3808.   X      (output)  : world x-coordinate of the pen position.
  3809.   Y      (output)  : world y-coordinate of the pen position.
  3810.  
  3811. %PGQTBG
  3812.  inquire text background color index
  3813.      SUBROUTINE PGQTBG (TBCI)
  3814.      INTEGER  TBCI
  3815.  
  3816.  Query the current Text Background Color Index (set by routine
  3817.  PGSTBG).
  3818.  
  3819.  Argument:
  3820.   TBCI   (output) : receives the current text background color index.
  3821.  
  3822. %PGQTXT
  3823.  find bounding box of text string
  3824.      SUBROUTINE PGQTXT (X, Y, ANGLE, FJUST, TEXT, XBOX, YBOX)
  3825.      REAL X, Y, ANGLE, FJUST
  3826.      CHARACTER*(*) TEXT
  3827.      REAL XBOX(4), YBOX(4)
  3828.  
  3829.  This routine returns a bounding box for a text string. Instead
  3830.  of drawing the string as routine PGPTXT does, it returns in XBOX
  3831.  and YBOX the coordinates of the corners of a rectangle parallel
  3832.  to the string baseline that just encloses the string. The four
  3833.  corners are in the order: lower left, upper left, upper right,
  3834.  lower right (where left and right refer to the first and last
  3835.  characters in the string).
  3836.  
  3837.  If the string is blank or contains no drawable characters, all
  3838.  four elements of XBOX and YBOX are assigned the starting point
  3839.  of the string, (X,Y).
  3840.  
  3841.  Arguments:
  3842.   X, Y, ANGLE, FJUST, TEXT (input) : these arguments are the same as
  3843.                     the corrresponding arguments in PGPTXT.
  3844.   XBOX, YBOX (output) : arrays of dimension 4; on output, they
  3845.                     contain the world coordinates of the bounding
  3846.                     box in (XBOX(1), YBOX(1)), ..., (XBOX(4), YBOX(4)).
  3847.  
  3848. %PGQVP
  3849.  inquire viewport size and position
  3850.      SUBROUTINE PGQVP (UNITS, X1, X2, Y1, Y2)
  3851.      INTEGER UNITS
  3852.      REAL    X1, X2, Y1, Y2
  3853.  
  3854.  Inquiry routine to determine the current viewport setting.
  3855.  The values returned may be normalized device coordinates, inches, mm,
  3856.  or pixels, depending on the value of the input parameter CFLAG.
  3857.  
  3858.  Arguments:
  3859.   UNITS  (input)  : used to specify the units of the output parameters:
  3860.                     UNITS = 0 : normalized device coordinates
  3861.                     UNITS = 1 : inches
  3862.                     UNITS = 2 : millimeters
  3863.                     UNITS = 3 : pixels
  3864.                     Other values give an error message, and are
  3865.                     treated as 0.
  3866.   X1     (output) : the x-coordinate of the bottom left corner of the
  3867.                     viewport.
  3868.   X2     (output) : the x-coordinate of the top right corner of the
  3869.                     viewport.
  3870.   Y1     (output) : the y-coordinate of the bottom left corner of the
  3871.                     viewport.
  3872.   Y2     (output) : the y-coordinate of the top right corner of the
  3873.                     viewport.
  3874.  
  3875. %PGQVSZ
  3876.  inquire size of view surface
  3877.      SUBROUTINE PGQVSZ (UNITS, X1, X2, Y1, Y2)
  3878.      INTEGER UNITS
  3879.      REAL X1, X2, Y1, Y2
  3880.  
  3881.  This routine returns the dimensions of the view surface (the maximum
  3882.  plottable area) of the currently selected graphics device, in
  3883.  a variety of units. The size of the view surface is device-dependent
  3884.  and is established when the graphics device is opened. On some
  3885.  devices, it can be changed by calling PGPAP before starting a new
  3886.  page with PGPAGE. On some devices, the size can be changed (e.g.,
  3887.  by a workstation window manager) outside PGPLOT, and PGPLOT detects
  3888.  the change when PGPAGE is used. Call this routine after PGPAGE to
  3889.  find the current size.
  3890.  
  3891.  Note 1: the width and the height of the view surface in normalized
  3892.  device coordinates are both always equal to 1.0.
  3893.  
  3894.  Note 2: when the device is divided into panels (see PGSUBP), the
  3895.  view surface is a single panel.
  3896.  
  3897.  Arguments:
  3898.   UNITS  (input)  : 0,1,2,3 for output in normalized device coords,
  3899.                     inches, mm, or device units (pixels)
  3900.   X1     (output) : always returns 0.0
  3901.   X2     (output) : width of view surface
  3902.   Y1     (output) : always returns 0.0
  3903.   Y2     (output) : height of view surface
  3904.  
  3905. %PGQWIN
  3906.  inquire window boundary coordinates
  3907.      SUBROUTINE PGQWIN (X1, X2, Y1, Y2)
  3908.      REAL X1, X2, Y1, Y2
  3909.  
  3910.  Inquiry routine to determine the current window setting.
  3911.  The values returned are world coordinates.
  3912.  
  3913.  Arguments:
  3914.   X1     (output) : the x-coordinate of the bottom left corner
  3915.                     of the window.
  3916.   X2     (output) : the x-coordinate of the top right corner
  3917.                     of the window.
  3918.   Y1     (output) : the y-coordinate of the bottom left corner
  3919.                     of the window.
  3920.   Y2     (output) : the y-coordinate of the top right corner
  3921.                     of the window.
  3922.  
  3923. %PGRECT
  3924.  draw a rectangle, using fill-area attributes
  3925.      SUBROUTINE PGRECT (X1, X2, Y1, Y2)
  3926.      REAL X1, X2, Y1, Y2
  3927.  
  3928.  This routine can be used instead of PGPOLY for the special case of
  3929.  drawing a rectangle aligned with the coordinate axes; only two
  3930.  vertices need be specified instead of four.  On most devices, it is
  3931.  faster to use PGRECT than PGPOLY for drawing rectangles.  The
  3932.  rectangle has vertices at (X1,Y1), (X1,Y2), (X2,Y2), and (X2,Y1).
  3933.  
  3934.  Arguments:
  3935.   X1, X2 (input) : the horizontal range of the rectangle.
  3936.   Y1, Y2 (input) : the vertical range of the rectangle.
  3937.  
  3938. %PGRND
  3939.  find the smallest `round' number greater than x
  3940.      REAL FUNCTION PGRND (X, NSUB)
  3941.      REAL X
  3942.      INTEGER NSUB
  3943.  
  3944.  Routine to find the smallest "round" number larger than x, a
  3945.  "round" number being 1, 2 or 5 times a power of 10. If X is negative,
  3946.  PGRND(X) = -PGRND(ABS(X)). eg PGRND(8.7) = 10.0,
  3947.  PGRND(-0.4) = -0.5.  If X is zero, the value returned is zero.
  3948.  This routine is used by PGBOX for choosing  tick intervals.
  3949.  
  3950.  Returns:
  3951.   PGRND         : the "round" number.
  3952.  Arguments:
  3953.   X      (input)  : the number to be rounded.
  3954.   NSUB   (output) : a suitable number of subdivisions for
  3955.                     subdividing the "nice" number: 2 or 5.
  3956.  
  3957. %PGRNGE
  3958.  choose axis limits
  3959.      SUBROUTINE PGRNGE (X1, X2, XLO, XHI)
  3960.      REAL X1, X2, XLO, XHI
  3961.  
  3962.  Choose plotting limits XLO and XHI which encompass the data
  3963.  range X1 to X2.
  3964.  
  3965.  Arguments:
  3966.   X1, X2 (input)  : the data range (X1<X2), ie, the min and max values
  3967.                     to be plotted.
  3968.   XLO, XHI (output) : suitable values to use as the extremes of a graph
  3969.                     axis (XLO <= X1, XHI >= X2).
  3970.  
  3971. %PGSAH
  3972.  set arrow-head style
  3973.      SUBROUTINE PGSAH (FS, ANGLE, BARB)
  3974.      INTEGER  FS
  3975.      REAL ANGLE, BARB
  3976.  
  3977.  Set the style to be used for arrowheads drawn with routine PGARRO.
  3978.  
  3979.  Argument:
  3980.   FS     (input)  : FS = 1 => filled; FS = 2 => outline.
  3981.                     Other values are treated as 2. Default 1.
  3982.   ANGLE  (input)  : the acute angle of the arrow point, in degrees;
  3983.                     angles in the range 20.0 to 90.0 give reasonable
  3984.                     results. Default 45.0.
  3985.   BARB   (input)  : the fraction of the triangular arrow-head that
  3986.                     is cut away from the back. 0.0 gives a triangular
  3987.                     wedge arrow-head; 1.0 gives an open >. Values 0.3
  3988.                     to 0.7 give reasonable results. Default 0.3.
  3989.  
  3990. %PGSAVE
  3991.  save PGPLOT attributes
  3992.      SUBROUTINE PGSAVE
  3993.  
  3994.  This routine saves the current PGPLOT attributes in a private storage
  3995.  area. They can be restored by calling PGUNSA (unsave). Attributes
  3996.  saved are: character font, character height, color index, fill-area
  3997.  style, line style, line width, pen position, arrow-head style,
  3998.  hatching style, and clipping state. Color representation is not saved.
  3999.  
  4000.  Calls to PGSAVE and PGUNSA should always be paired. Up to 20 copies
  4001.  of the attributes may be saved. PGUNSA always retrieves the last-saved
  4002.  values (last-in first-out stack).
  4003.  
  4004.  Note that when multiple devices are in use, PGUNSA retrieves the
  4005.  values saved by the last PGSAVE call, even if they were for a
  4006.  different device.
  4007.  
  4008.  Arguments: none
  4009.  
  4010. %PGUNSA
  4011.  restore PGPLOT attributes
  4012.      ENTRY PGUNSA
  4013.  
  4014.  This routine restores the PGPLOT attributes saved in the last call to
  4015.  PGSAVE. Usage: CALL PGUNSA (no arguments). See PGSAVE.
  4016.  
  4017.  Arguments: none
  4018.  
  4019. %PGSCF
  4020.  set character font
  4021.      SUBROUTINE PGSCF (FONT)
  4022.      INTEGER  FONT
  4023.  
  4024.  Set the Character Font for subsequent text plotting. Four different
  4025.  fonts are available:
  4026.    1: (default) a simple single-stroke font ("normal" font)
  4027.    2: roman font
  4028.    3: italic font
  4029.    4: script font
  4030.  This call determines which font is in effect at the beginning of
  4031.  each text string. The font can be changed (temporarily) within a text
  4032.  string by using the escape sequences \fn, \fr, \fi, and \fs for fonts
  4033.  1, 2, 3, and 4, respectively.
  4034.  
  4035.  Argument:
  4036.   FONT   (input)  : the font number to be used for subsequent text
  4037.                     plotting (in range 1-4).
  4038.  
  4039. %PGSCH
  4040.  set character height
  4041.      SUBROUTINE PGSCH (SIZE)
  4042.      REAL SIZE
  4043.  
  4044.  Set the character size attribute. The size affects all text and graph
  4045.  markers drawn later in the program. The default character size is
  4046.  1.0, corresponding to a character height about 1/40 the height of
  4047.  the view surface.  Changing the character size also scales the length
  4048.  of tick marks drawn by PGBOX and terminals drawn by PGERRX and PGERRY.
  4049.  
  4050.  Argument:
  4051.   SIZE   (input)  : new character size (dimensionless multiple of
  4052.                     the default size).
  4053.  
  4054. %PGSCI
  4055.  set color index
  4056.      SUBROUTINE PGSCI (CI)
  4057.      INTEGER  CI
  4058.  
  4059.  Set the Color Index for subsequent plotting, if the output device
  4060.  permits this. The default color index is 1, usually white on a black
  4061.  background for video displays or black on a white background for
  4062.  printer plots. The color index is an integer in the range 0 to a
  4063.  device-dependent maximum. Color index 0 corresponds to the background
  4064.  color; lines may be "erased" by overwriting them with color index 0
  4065.  (if the device permits this).
  4066.  
  4067.  If the requested color index is not available on the selected device,
  4068.  color index 1 will be substituted.
  4069.  
  4070.  The assignment of colors to color indices can be changed with
  4071.  subroutine PGSCR (set color representation).  Color indices 0-15
  4072.  have predefined color representations (see the PGPLOT manual), but
  4073.  these may be changed with PGSCR.  Color indices above 15  have no
  4074.  predefined representations: if these indices are used, PGSCR must
  4075.  be called to define the representation.
  4076.  
  4077.  Argument:
  4078.   CI     (input)  : the color index to be used for subsequent plotting
  4079.                     on the current device (in range 0-max). If the
  4080.                     index exceeds the device-dependent maximum, the
  4081.                     default color index (1) is used.
  4082.  
  4083. %PGSCIR
  4084.  set color index range
  4085.      SUBROUTINE PGSCIR(ICILO, ICIHI)
  4086.      INTEGER   ICILO, ICIHI
  4087.  
  4088.  Set the color index range to be used for producing images with
  4089.  PGGRAY or PGIMAG. If the range is not all within the range supported
  4090.  by the device, a smaller range will be used. The number of
  4091.  different colors available for images is ICIHI-ICILO+1.
  4092.  
  4093.  Arguments:
  4094.   ICILO  (input)  : the lowest color index to use for images
  4095.   ICIHI  (input)  : the highest color index to use for images
  4096.  
  4097. %PGSCLP
  4098.  enable or disable clipping at edge of viewport
  4099.      SUBROUTINE PGSCLP(STATE)
  4100.      INTEGER STATE
  4101.  
  4102.  Normally all PGPLOT primitives except text are ``clipped'' at the
  4103.  edge of the viewport: parts of the primitives that lie outside
  4104.  the viewport are not drawn. If clipping is disabled by calling this
  4105.  routine, primitives are visible wherever they lie on the view
  4106.  surface. The default (clipping enabled) is appropriate for almost
  4107.  all applications.
  4108.  
  4109.  Argument:
  4110.   STATE  (input)  : 0 to disable clipping, or 1 to enable clipping.
  4111.  
  4112.  25-Feb-1997 [TJP] - new routine.
  4113.  
  4114. %PGSCR
  4115.  set color representation
  4116.      SUBROUTINE PGSCR (CI, CR, CG, CB)
  4117.      INTEGER CI
  4118.      REAL    CR, CG, CB
  4119.  
  4120.  Set color representation: i.e., define the color to be
  4121.  associated with a color index.  Ignored for devices which do not
  4122.  support variable color or intensity.  Color indices 0-15
  4123.  have predefined color representations (see the PGPLOT manual), but
  4124.  these may be changed with PGSCR.  Color indices 16-maximum have no
  4125.  predefined representations: if these indices are used, PGSCR must
  4126.  be called to define the representation. On monochrome output
  4127.  devices (e.g. VT125 terminals with monochrome monitors), the
  4128.  monochrome intensity is computed from the specified Red, Green, Blue
  4129.  intensities as 0.30*R + 0.59*G + 0.11*B, as in US color television
  4130.  systems, NTSC encoding.  Note that most devices do not have an
  4131.  infinite range of colors or monochrome intensities available;
  4132.  the nearest available color is used.  Examples: for black,
  4133.  set CR=CG=CB=0.0; for white, set CR=CG=CB=1.0; for medium gray,
  4134.  set CR=CG=CB=0.5; for medium yellow, set CR=CG=0.5, CB=0.0.
  4135.  
  4136.  Argument:
  4137.   CI     (input)  : the color index to be defined, in the range 0-max.
  4138.                     If the color index greater than the device
  4139.                     maximum is specified, the call is ignored. Color
  4140.                     index 0 applies to the background color.
  4141.   CR     (input)  : red, green, and blue intensities,
  4142.   CG     (input)    in range 0.0 to 1.0.
  4143.   CB     (input)
  4144.  
  4145. %PGSCRL
  4146.  scroll window
  4147.      SUBROUTINE PGSCRL (DX, DY)
  4148.      REAL DX, DY
  4149.  
  4150.  This routine moves the window in world-coordinate space while
  4151.  leaving the viewport unchanged. On devices that have the
  4152.  capability, the pixels within the viewport are scrolled
  4153.  horizontally, vertically or both in such a way that graphics
  4154.  previously drawn in the window are shifted so that their world
  4155.  coordinates are unchanged.
  4156.  
  4157.  If the old window coordinate range was (X1, X2, Y1, Y2), the new
  4158.  coordinate range will be approximately (X1+DX, X2+DX, Y1+DY, Y2+DY).
  4159.  The size and scale of the window are unchanged.
  4160.  
  4161.  Thee window can only be shifted by a whole number of pixels
  4162.  (device coordinates). If DX and DY do not correspond to integral
  4163.  numbers of pixels, the shift will be slightly different from that
  4164.  requested. The new window-coordinate range, and hence the exact
  4165.  amount of the shift, can be determined by calling PGQWIN after this
  4166.  routine.
  4167.  
  4168.  Pixels that are moved out of the viewport by this operation are
  4169.  lost completely; they cannot be recovered by scrolling back.
  4170.  Pixels that are ``scrolled into'' the viewport are filled with
  4171.  the background color (color index 0).
  4172.  
  4173.  If the absolute value of DX is bigger than the width of the window,
  4174.  or the aboslute value of DY is bigger than the height of the window,
  4175.  the effect will be the same as zeroing all the pixels in the
  4176.  viewport.
  4177.  
  4178.  Not all devices have the capability to support this routine.
  4179.  It is only available on some interactive devices that have discrete
  4180.  pixels. To determine whether the current device has scroll capability,
  4181.  call PGQINF.
  4182.  
  4183.  Arguments:
  4184.   DX     (input)  : distance (in world coordinates) to shift the
  4185.                     window horizontally (positive shifts window to the
  4186.                     right and scrolls to the left).
  4187.   DY     (input)  : distance (in world coordinates) to shift the
  4188.                     window vertically (positive shifts window up and
  4189.                     scrolls down).
  4190.  
  4191. %PGSCRN
  4192.  set color representation by name
  4193.      SUBROUTINE PGSCRN(CI, NAME, IER)
  4194.      INTEGER CI
  4195.      CHARACTER*(*) NAME
  4196.      INTEGER IER
  4197.  
  4198.  Set color representation: i.e., define the color to be
  4199.  associated with a color index.  Ignored for devices which do not
  4200.  support variable color or intensity.  This is an alternative to
  4201.  routine PGSCR. The color representation is defined by name instead
  4202.  of (R,G,B) components.
  4203.  
  4204.  Color names are defined in an external file which is read the first
  4205.  time that PGSCRN is called. The name of the external file is
  4206.  found as follows:
  4207.  1. if environment variable (logical name) PGPLOT_RGB is defined,
  4208.     its value is used as the file name;
  4209.  2. otherwise, if environment variable PGPLOT_DIR is defined, a
  4210.     file "rgb.txt" in the directory named by this environment
  4211.     variable is used;
  4212.  3. otherwise, file "rgb.txt" in the current directory is used.
  4213.  If all of these fail to find a file, an error is reported and
  4214.  the routine does nothing.
  4215.  
  4216.  Each line of the file
  4217.  defines one color, with four blank- or tab-separated fields per
  4218.  line. The first three fields are the R, G, B components, which
  4219.  are integers in the range 0 (zero intensity) to 255 (maximum
  4220.  intensity). The fourth field is the color name. The color name
  4221.  may include embedded blanks. Example:
  4222.  
  4223.  255   0   0 red
  4224.  255 105 180 hot pink
  4225.  255 255 255 white
  4226.    0   0   0 black
  4227.  
  4228.  Arguments:
  4229.   CI     (input)  : the color index to be defined, in the range 0-max.
  4230.                     If the color index greater than the device
  4231.                     maximum is specified, the call is ignored. Color
  4232.                     index 0 applies to the background color.
  4233.   NAME   (input)  : the name of the color to be associated with
  4234.                     this color index. This name must be in the
  4235.                     external file. The names are not case-sensitive.
  4236.                     If the color is not listed in the file, the
  4237.                     color representation is not changed.
  4238.   IER    (output) : returns 0 if the routine was successful, 1
  4239.                     if an error occurred (either the external file
  4240.                     could not be read, or the requested color was
  4241.                     not defined in the file).
  4242.  
  4243. %PGSFS
  4244.  set fill-area style
  4245.      SUBROUTINE PGSFS (FS)
  4246.      INTEGER  FS
  4247.  
  4248.  Set the Fill-Area Style attribute for subsequent area-fill by
  4249.  PGPOLY, PGRECT, or PGCIRC.  Four different styles are available:
  4250.  solid (fill polygon with solid color of the current color-index),
  4251.  outline (draw outline of polygon only, using current line attributes),
  4252.  hatched (shade interior of polygon with parallel lines, using
  4253.  current line attributes), or cross-hatched. The orientation and
  4254.  spacing of hatch lines can be specified with routine PGSHS (set
  4255.  hatch style).
  4256.  
  4257.  Argument:
  4258.   FS     (input)  : the fill-area style to be used for subsequent
  4259.                     plotting:
  4260.                       FS = 1 => solid (default)
  4261.                       FS = 2 => outline
  4262.                       FS = 3 => hatched
  4263.                       FS = 4 => cross-hatched
  4264.                     Other values give an error message and are
  4265.                     treated as 2.
  4266.  
  4267. %PGSHLS
  4268.  set color representation using HLS system
  4269.      SUBROUTINE PGSHLS (CI, CH, CL, CS)
  4270.      INTEGER CI
  4271.      REAL    CH, CL, CS
  4272.  
  4273.  Set color representation: i.e., define the color to be
  4274.  associated with a color index.  This routine is equivalent to
  4275.  PGSCR, but the color is defined in the Hue-Lightness-Saturation
  4276.  model instead of the Red-Green-Blue model. Hue is represented
  4277.  by an angle in degrees, with red at 120, green at 240,
  4278.  and blue at 0 (or 360). Lightness ranges from 0.0 to 1.0, with black
  4279.  at lightness 0.0 and white at lightness 1.0. Saturation ranges from
  4280.  0.0 (gray) to 1.0 (pure color). Hue is irrelevant when saturation
  4281.  is 0.0.
  4282.  
  4283.  Examples:           H     L     S        R     G     B
  4284.      black          any   0.0   0.0      0.0   0.0   0.0
  4285.      white          any   1.0   0.0      1.0   1.0   1.0
  4286.      medium gray    any   0.5   0.0      0.5   0.5   0.5
  4287.      red            120   0.5   1.0      1.0   0.0   0.0
  4288.      yellow         180   0.5   1.0      1.0   1.0   0.0
  4289.      pink           120   0.7   0.8      0.94  0.46  0.46
  4290.  
  4291.  Reference: SIGGRAPH Status Report of the Graphic Standards Planning
  4292.  Committee, Computer Graphics, Vol.13, No.3, Association for
  4293.  Computing Machinery, New York, NY, 1979. See also: J. D. Foley et al,
  4294.  ``Computer Graphics: Principles and Practice'', second edition,
  4295.  Addison-Wesley, 1990, section 13.3.5.
  4296.  
  4297.  Argument:
  4298.   CI     (input)  : the color index to be defined, in the range 0-max.
  4299.                     If the color index greater than the device
  4300.                     maximum is specified, the call is ignored. Color
  4301.                     index 0 applies to the background color.
  4302.   CH     (input)  : hue, in range 0.0 to 360.0.
  4303.   CL     (input)  : lightness, in range 0.0 to 1.0.
  4304.   CS     (input)  : saturation, in range 0.0 to 1.0.
  4305.  
  4306. %PGSHS
  4307.  set hatching style
  4308.      SUBROUTINE PGSHS (ANGLE, SEPN, PHASE)
  4309.      REAL ANGLE, SEPN, PHASE
  4310.  
  4311.  Set the style to be used for hatching (fill area with fill-style 3).
  4312.  The default style is ANGLE=45.0, SEPN=1.0, PHASE=0.0.
  4313.  
  4314.  Arguments:
  4315.   ANGLE  (input)  : the angle the hatch lines make with the
  4316.                     horizontal, in degrees, increasing
  4317.                     counterclockwise (this is an angle on the
  4318.                     view surface, not in world-coordinate space).
  4319.   SEPN   (input)  : the spacing of the hatch lines. The unit spacing
  4320.                     is 1 percent of the smaller of the height or
  4321.                     width of the view surface. This should not be
  4322.                     zero.
  4323.   PHASE  (input)  : a real number between 0 and 1; the hatch lines
  4324.                     are displaced by this fraction of SEPN from a
  4325.                     fixed reference.  Adjacent regions hatched with the
  4326.                     same PHASE have contiguous hatch lines. To hatch
  4327.                     a region with alternating lines of two colors,
  4328.                     fill the area twice, with PHASE=0.0 for one color
  4329.                     and PHASE=0.5 for the other color.
  4330.  
  4331. %PGSITF
  4332.  set image transfer function
  4333.      SUBROUTINE PGSITF (ITF)
  4334.      INTEGER  ITF
  4335.  
  4336.  Set the Image Transfer Function for subsequent images drawn by
  4337.  PGIMAG, PGGRAY, or PGWEDG. The Image Transfer Function is used
  4338.  to map array values into the available range of color indices
  4339.  specified with routine PGSCIR or (for PGGRAY on some devices)
  4340.  into dot density.
  4341.  
  4342.  Argument:
  4343.   ITF    (input)  : type of transfer function:
  4344.                       ITF = 0 : linear
  4345.                       ITF = 1 : logarithmic
  4346.                       ITF = 2 : square-root
  4347.  
  4348. %PGSLCT
  4349.  select an open graphics device
  4350.      SUBROUTINE PGSLCT(ID)
  4351.      INTEGER ID
  4352.  
  4353.  Select one of the open graphics devices and direct subsequent
  4354.  plotting to it. The argument is the device identifier returned by
  4355.  PGOPEN when the device was opened. If the supplied argument is not a
  4356.  valid identifier of an open graphics device, a warning message is
  4357.  issued and the current selection is unchanged.
  4358.  
  4359.  [This routine was added to PGPLOT in Version 5.1.0.]
  4360.  
  4361.  Arguments:
  4362.  
  4363.  ID (input, integer): identifier of the device to be selected.
  4364.  
  4365. %PGSLS
  4366.  set line style
  4367.      SUBROUTINE PGSLS (LS)
  4368.      INTEGER  LS
  4369.  
  4370.  Set the line style attribute for subsequent plotting. This
  4371.  attribute affects line primitives only; it does not affect graph
  4372.  markers, text, or area fill.
  4373.  Five different line styles are available, with the following codes:
  4374.  1 (full line), 2 (dashed), 3 (dot-dash-dot-dash), 4 (dotted),
  4375.  5 (dash-dot-dot-dot). The default is 1 (normal full line).
  4376.  
  4377.  Argument:
  4378.   LS     (input)  : the line-style code for subsequent plotting
  4379.                     (in range 1-5).
  4380.  
  4381. %PGSLW
  4382.  set line width
  4383.      SUBROUTINE PGSLW (LW)
  4384.      INTEGER  LW
  4385.  
  4386.  Set the line-width attribute. This attribute affects lines, graph
  4387.  markers, and text. The line width is specified in units of 1/200
  4388.  (0.005) inch (about 0.13 mm) and must be an integer in the range
  4389.  1-201. On some devices, thick lines are generated by tracing each
  4390.  line with multiple strokes offset in the direction perpendicular to
  4391.  the line.
  4392.  
  4393.  Argument:
  4394.   LW     (input)  : width of line, in units of 0.005 inch (0.13 mm)
  4395.                     in range 1-201.
  4396.  
  4397. %PGSTBG
  4398.  set text background color index
  4399.      SUBROUTINE PGSTBG (TBCI)
  4400.      INTEGER  TBCI
  4401.  
  4402.  Set the Text Background Color Index for subsequent text. By default
  4403.  text does not obscure underlying graphics. If the text background
  4404.  color index is positive, however, text is opaque: the bounding box
  4405.  of the text is filled with the color specified by PGSTBG before
  4406.  drawing the text characters in the current color index set by PGSCI.
  4407.  Use color index 0 to erase underlying graphics before drawing text.
  4408.  
  4409.  Argument:
  4410.   TBCI   (input)  : the color index to be used for the background
  4411.                     for subsequent text plotting:
  4412.                       TBCI < 0  => transparent (default)
  4413.                       TBCI >= 0 => text will be drawn on an opaque
  4414.                     background with color index TBCI.
  4415.  
  4416. %PGSUBP
  4417.  subdivide view surface into panels
  4418.      SUBROUTINE PGSUBP (NXSUB, NYSUB)
  4419.      INTEGER NXSUB, NYSUB
  4420.  
  4421.  PGPLOT divides the physical surface of the plotting device (screen,
  4422.  window, or sheet of paper) into NXSUB x NYSUB `panels'. When the
  4423.  view surface is sub-divided in this way, PGPAGE moves to the next
  4424.  panel, not the next physical page. The initial subdivision of the
  4425.  view surface is set in the call to PGBEG. When PGSUBP is called,
  4426.  it forces the next call to PGPAGE to start a new physical page,
  4427.  subdivided in the manner indicated. No plotting should be done
  4428.  between a call of PGSUBP and a call of PGPAGE (or PGENV, which calls
  4429.  PGPAGE).
  4430.  
  4431.  If NXSUB > 0, PGPLOT uses the panels in row order; if <0,
  4432.  PGPLOT uses them in column order, e.g.,
  4433.  
  4434.   NXSUB=3, NYSUB=2            NXSUB=-3, NYSUB=2
  4435.  
  4436.  +-----+-----+-----+         +-----+-----+-----+
  4437.  |  1  |  2  |  3  |         |  1  |  3  |  5  |
  4438.  +-----+-----+-----+         +-----+-----+-----+
  4439.  |  4  |  5  |  6  |         |  2  |  4  |  6  |
  4440.  +-----+-----+-----+         +-----+-----+-----+
  4441.  
  4442.  PGPLOT advances from one panels to the next when PGPAGE is called,
  4443.  clearing the screen or starting a new page when the last panel has
  4444.  been used. It is also possible to jump from one panel to another
  4445.  in random order by calling PGPANL.
  4446.  
  4447.  Arguments:
  4448.   NXSUB  (input)  : the number of subdivisions of the view surface in
  4449.                     X (>0 or <0).
  4450.   NYSUB  (input)  : the number of subdivisions of the view surface in
  4451.                     Y (>0).
  4452.  
  4453. %PGSVP
  4454.  set viewport (normalized device coordinates)
  4455.      SUBROUTINE PGSVP (XLEFT, XRIGHT, YBOT, YTOP)
  4456.      REAL XLEFT, XRIGHT, YBOT, YTOP
  4457.  
  4458.  Change the size and position of the viewport, specifying
  4459.  the viewport in normalized device coordinates.  Normalized
  4460.  device coordinates run from 0 to 1 in each dimension. The
  4461.  viewport is the rectangle on the view surface "through"
  4462.  which one views the graph.  All the PG routines which plot lines
  4463.  etc. plot them within the viewport, and lines are truncated at
  4464.  the edge of the viewport (except for axes, labels etc drawn with
  4465.  PGBOX or PGLAB).  The region of world space (the coordinate
  4466.  space of the graph) which is visible through the viewport is
  4467.  specified by a call to PGSWIN.  It is legal to request a
  4468.  viewport larger than the view surface; only the part which
  4469.  appears on the view surface will be plotted.
  4470.  
  4471.  Arguments:
  4472.   XLEFT  (input)  : x-coordinate of left hand edge of viewport, in NDC.
  4473.   XRIGHT (input)  : x-coordinate of right hand edge of viewport,
  4474.                     in NDC.
  4475.   YBOT   (input)  : y-coordinate of bottom edge of viewport, in NDC.
  4476.   YTOP   (input)  : y-coordinate of top  edge of viewport, in NDC.
  4477.  
  4478. %PGSWIN
  4479.  set window
  4480.      SUBROUTINE PGSWIN (X1, X2, Y1, Y2)
  4481.      REAL X1, X2, Y1, Y2
  4482.  
  4483.  Change the window in world coordinate space that is to be mapped on
  4484.  to the viewport.  Usually PGSWIN is called automatically by PGENV,
  4485.  but it may be called directly by the user.
  4486.  
  4487.  Arguments:
  4488.   X1     (input)  : the x-coordinate of the bottom left corner
  4489.                     of the viewport.
  4490.   X2     (input)  : the x-coordinate of the top right corner
  4491.                     of the viewport (note X2 may be less than X1).
  4492.   Y1     (input)  : the y-coordinate of the bottom left corner
  4493.                     of the viewport.
  4494.   Y2     (input)  : the y-coordinate of the top right corner
  4495.                     of the viewport (note Y2 may be less than Y1).
  4496.  
  4497. %PGTBOX
  4498.  draw frame and write (DD) HH MM SS.S labelling
  4499.      SUBROUTINE PGTBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
  4500.  
  4501.      REAL XTICK, YTICK
  4502.      INTEGER NXSUB, NYSUB
  4503.      CHARACTER XOPT*(*), YOPT*(*)
  4504.  
  4505.  Draw a box and optionally label one or both axes with (DD) HH MM SS
  4506.  style numeric labels (useful for time or RA - DEC plots).   If this
  4507.  style of labelling is desired, then PGSWIN should have been called
  4508.  previously with the extrema in SECONDS of time.
  4509.  
  4510.  In the seconds field, you can have at most 3 places after the decimal
  4511.  point, so that 1 ms is the smallest time interval you can time label.
  4512.  
  4513.  Large numbers are coped with by fields of 6 characters long.  Thus
  4514.  you could have times with days or hours as big as 999999.  However,
  4515.  in practice, you might have trouble with labels overwriting  themselves
  4516.  with such large numbers unless you a) use a small time INTERVAL,
  4517.  b) use a small character size or c) choose your own sparse ticks in
  4518.  the call to PGTBOX.
  4519.  
  4520.  PGTBOX will attempt, when choosing its own ticks, not to overwrite
  4521.  the labels, but this algorithm is not very bright and may fail.
  4522.  
  4523.  Note that small intervals but large absolute times such as
  4524.  TMIN = 200000.0 s and TMAX=200000.1 s will cause the algorithm
  4525.  to fail.  This is inherent in PGPLOT's use of single precision
  4526.  and cannot be avoided.  In such cases, you should use relative
  4527.  times if possible.
  4528.  
  4529.  PGTBOX's labelling philosophy is that the left-most or bottom tick of
  4530.  the axis contains a full label.  Thereafter, only changing fields are
  4531.  labelled.  Negative fields are given a '-' label, positive fields
  4532.  have none.   Axes that have the DD (or HH if the day field is not
  4533.  used) field on each major tick carry the sign on each field.  If the
  4534.  axis crosses zero, the zero tick will carry a full label and sign.
  4535.  
  4536.  This labelling style can cause a little confusion with some special
  4537.  cases, but as long as you know its philosophy, the truth can be divined.
  4538.  Consider an axis with TMIN=20s, TMAX=-20s.   The labels will look like
  4539.  
  4540.         +----------+----------+----------+----------+
  4541.      0h0m20s      10s      -0h0m0s      10s        20s
  4542.  
  4543.  Knowing that the left field always has a full label and that
  4544.  positive fields are unsigned, informs that time is decreasing
  4545.  from left to right, not vice versa.   This can become very
  4546.  unclear if you have used the 'F' option, but that is your problem !
  4547.  
  4548.  Exceptions to this labelling philosophy are when the finest time
  4549.  increment being displayed is hours (with option 'Y') or days.
  4550.  Then all fields carry a label.  For example,
  4551.  
  4552.         +----------+----------+----------+----------+
  4553.       -10h        -8h        -6h        -4h        -2h
  4554.  
  4555.  
  4556.  PGTBOX can be used in place of PGBOX; it calls PGBOX and only invokes
  4557.  time labelling if requested. Other options are passed intact to PGBOX.
  4558.  
  4559.  Inputs:
  4560.   XOPT   :  X-options for PGTBOX.  Same as for PGBOX plus
  4561.  
  4562.              'Z' for (DD) HH MM SS.S time labelling
  4563.              'Y' means don't include the day field so that labels
  4564.                  are HH MM SS.S rather than DD HH MM SS.S   The hours
  4565.                  will accumulate beyond 24 if necessary in this case.
  4566.              'X' label the HH field as modulo 24.  Thus, a label
  4567.                  such as 25h 10m would come out as 1h 10m
  4568.              'H' means superscript numbers with d, h, m, & s  symbols
  4569.              'D' means superscript numbers with    o, ', & '' symbols
  4570.              'F' causes the first label (left- or bottom-most) to
  4571.                  be omitted. Useful for sub-panels that abut each other.
  4572.                  Care is needed because first label carries sign as well.
  4573.              'O' means omit leading zeros in numbers < 10
  4574.                  E.g.  3h 3m 1.2s rather than 03h 03m 01.2s  Useful
  4575.                  to help save space on X-axes. The day field does not
  4576.                  use this facility.
  4577.  
  4578.   YOPT   :  Y-options for PGTBOX.  See above.
  4579.   XTICK  :  X-axis major tick increment.  0.0 for default.
  4580.   YTICK  :  Y-axis major tick increment.  0.0 for default.
  4581.             If the 'Z' option is used then XTICK and/or YTICK must
  4582.             be in seconds.
  4583.   NXSUB  :  Number of intervals for minor ticks on X-axis. 0 for default
  4584.   NYSUB  :  Number of intervals for minor ticks on Y-axis. 0 for default
  4585.  
  4586.   The regular XOPT and YOPT axis options for PGBOX are
  4587.  
  4588.   A : draw Axis (X axis is horizontal line Y=0, Y axis is vertical
  4589.       line X=0).
  4590.   B : draw bottom (X) or left (Y) edge of frame.
  4591.   C : draw top (X) or right (Y) edge of frame.
  4592.   G : draw Grid of vertical (X) or horizontal (Y) lines.
  4593.   I : Invert the tick marks; ie draw them outside the viewport
  4594.       instead of inside.
  4595.   L : label axis Logarithmically (see below).
  4596.   N : write Numeric labels in the conventional location below the
  4597.       viewport (X) or to the left of the viewport (Y).
  4598.   P : extend ("Project") major tick marks outside the box (ignored if
  4599.       option I is specified).
  4600.   M : write numeric labels in the unconventional location above the
  4601.       viewport (X) or to the right of the viewport (Y).
  4602.   T : draw major Tick marks at the major coordinate interval.
  4603.   S : draw minor tick marks (Subticks).
  4604.   V : orient numeric labels Vertically. This is only applicable to Y.
  4605.       The default is to write Y-labels parallel to the axis.
  4606.   1 : force decimal labelling, instead of automatic choice (see PGNUMB).
  4607.   2 : force exponential labelling, instead of automatic.
  4608.  
  4609.       The default is to write Y-labels parallel to the axis
  4610.  
  4611.  
  4612.         ******************        EXCEPTIONS       *******************
  4613.  
  4614.         Note that
  4615.           1) PGBOX option 'L' (log labels) is ignored with option 'Z'
  4616.           2) The 'O' option will be ignored for the 'V' option as it
  4617.              makes it impossible to align the labels nicely
  4618.           3) Option 'Y' is forced with option 'D'
  4619.  
  4620.         ***************************************************************
  4621.  
  4622.  
  4623.  
  4624. %PGTEXT
  4625.  write text (horizontal, left-justified)
  4626.      SUBROUTINE PGTEXT (X, Y, TEXT)
  4627.      REAL X, Y
  4628.      CHARACTER*(*) TEXT
  4629.  
  4630.  Write text. The bottom left corner of the first character is placed
  4631.  at the specified position, and the text is written horizontally.
  4632.  This is a simplified interface to the primitive routine PGPTXT.
  4633.  For non-horizontal text, use PGPTXT.
  4634.  
  4635.  Arguments:
  4636.   X      (input)  : world x-coordinate of start of string.
  4637.   Y      (input)  : world y-coordinate of start of string.
  4638.   TEXT   (input)  : the character string to be plotted.
  4639.  
  4640. %PGTICK
  4641.  draw a single tick mark on an axis
  4642.      SUBROUTINE PGTICK (X1, Y1, X2, Y2, V, TIKL, TIKR, DISP,
  4643.     :                   ORIENT, STR)
  4644.      REAL X1, Y1, X2, Y2, V, TIKL, TIKR, DISP, ORIENT
  4645.      CHARACTER*(*) STR
  4646.  
  4647.  Draw and label single tick mark on a graph axis. The tick mark is
  4648.  a short line perpendicular to the direction of the axis (which is not
  4649.  drawn by this routine). The optional text label is drawn with its
  4650.  baseline parallel to the axis and reading in the same direction as
  4651.  the axis (from point 1 to point 2). Current line and text attributes
  4652.  are used.
  4653.  
  4654.  Arguments:
  4655.   X1, Y1 (input)  : world coordinates of one endpoint of the axis.
  4656.   X2, Y2 (input)  : world coordinates of the other endpoint of the axis.
  4657.   V      (input)  : draw the tick mark at fraction V (0<=V<=1) along
  4658.                     the line from (X1,Y1) to (X2,Y2).
  4659.   TIKL   (input)  : length of tick mark drawn to left of axis
  4660.                     (as seen looking from first endpoint to second), in
  4661.                     units of the character height.
  4662.   TIKR   (input)  : length of major tick marks drawn to right of axis,
  4663.                     in units of the character height.
  4664.   DISP   (input)  : displacement of label text to
  4665.                     right of axis, in units of the character height.
  4666.   ORIENT (input)  : orientation of label text, in degrees; angle between
  4667.                     baseline of text and direction of axis (0-360°).
  4668.   STR    (input)  : text of label (may be blank).
  4669.  
  4670. %PGUPDT
  4671.  update display
  4672.      SUBROUTINE PGUPDT
  4673.  
  4674.  Update the graphics display: flush any pending commands to the
  4675.  output device. This routine empties the buffer created by PGBBUF,
  4676.  but it does not alter the PGBBUF/PGEBUF counter. The routine should
  4677.  be called when it is essential that the display be completely up to
  4678.  date (before interaction with the user, for example) but it is not
  4679.  known if output is being buffered.
  4680.  
  4681.  Arguments: none
  4682.  
  4683. %PGVECT
  4684.  vector map of a 2D data array, with blanking
  4685.      SUBROUTINE PGVECT (A, B, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR,
  4686.     1                   BLANK)
  4687.      INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  4688.      REAL    A(IDIM,JDIM), B(IDIM, JDIM), TR(6), BLANK, C
  4689.  
  4690.  Draw a vector map of two arrays.  This routine is similar to
  4691.  PGCONB in that array elements that have the "magic value" defined by
  4692.  the argument BLANK are ignored, making gaps in the vector map.  The
  4693.  routine may be useful for data measured on most but not all of the
  4694.  points of a grid. Vectors are displayed as arrows; the style of the
  4695.  arrowhead can be set with routine PGSAH, and the the size of the
  4696.  arrowhead is determined by the current character size, set by PGSCH.
  4697.  
  4698.  Arguments:
  4699.   A      (input)  : horizontal component data array.
  4700.   B      (input)  : vertical component data array.
  4701.   IDIM   (input)  : first dimension of A and B.
  4702.   JDIM   (input)  : second dimension of A and B.
  4703.   I1,I2  (input)  : range of first index to be mapped (inclusive).
  4704.   J1,J2  (input)  : range of second index to be mapped (inclusive).
  4705.   C      (input)  : scale factor for vector lengths, if 0.0, C will be
  4706.                     set so that the longest vector is equal to the
  4707.                     smaller of TR(2)+TR(3) and TR(5)+TR(6).
  4708.   NC     (input)  : vector positioning code.
  4709.                     <0 vector head positioned on coordinates
  4710.                     >0 vector base positioned on coordinates
  4711.                     =0 vector centered on the coordinates
  4712.   TR     (input)  : array defining a transformation between the I,J
  4713.                     grid of the array and the world coordinates. The
  4714.                     world coordinates of the array point A(I,J) are
  4715.                     given by:
  4716.                       X = TR(1) + TR(2)*I + TR(3)*J
  4717.                       Y = TR(4) + TR(5)*I + TR(6)*J
  4718.                     Usually TR(3) and TR(5) are zero - unless the
  4719.                     coordinate transformation involves a rotation
  4720.                     or shear.
  4721.   BLANK   (input) : elements of arrays A or B that are exactly equal to
  4722.                     this value are ignored (blanked).
  4723.  
  4724. %PGVPORT
  4725.  non-standard alias for PGSVP
  4726.      SUBROUTINE PGVPORT (XLEFT, XRIGHT, YBOT, YTOP)
  4727.      REAL XLEFT, XRIGHT, YBOT, YTOP
  4728.  
  4729.  See description of PGSVP.
  4730.  
  4731. %PGVSIZ
  4732.  set viewport (inches)
  4733.      SUBROUTINE PGVSIZ (XLEFT, XRIGHT, YBOT, YTOP)
  4734.      REAL XLEFT, XRIGHT, YBOT, YTOP
  4735.  
  4736.  Change the size and position of the viewport, specifying
  4737.  the viewport in physical device coordinates (inches).  The
  4738.  viewport is the rectangle on the view surface "through"
  4739.  which one views the graph.  All the PG routines which plot lines
  4740.  etc. plot them within the viewport, and lines are truncated at
  4741.  the edge of the viewport (except for axes, labels etc drawn with
  4742.  PGBOX or PGLAB).  The region of world space (the coordinate
  4743.  space of the graph) which is visible through the viewport is
  4744.  specified by a call to PGSWIN.  It is legal to request a
  4745.  viewport larger than the view surface; only the part which
  4746.  appears on the view surface will be plotted.
  4747.  
  4748.  Arguments:
  4749.   XLEFT  (input)  : x-coordinate of left hand edge of viewport, in
  4750.                     inches from left edge of view surface.
  4751.   XRIGHT (input)  : x-coordinate of right hand edge of viewport, in
  4752.                     inches from left edge of view surface.
  4753.   YBOT   (input)  : y-coordinate of bottom edge of viewport, in
  4754.                     inches from bottom of view surface.
  4755.   YTOP   (input)  : y-coordinate of top  edge of viewport, in inches
  4756.                     from bottom of view surface.
  4757.  
  4758. %PGVSIZE
  4759.  non-standard alias for PGVSIZ
  4760.      SUBROUTINE PGVSIZE (XLEFT, XRIGHT, YBOT, YTOP)
  4761.      REAL XLEFT, XRIGHT, YBOT, YTOP
  4762.  
  4763.  See description of PGVSIZ.
  4764.  
  4765. %PGVSTAND
  4766.  non-standard alias for PGVSTD
  4767.      SUBROUTINE PGVSTAND
  4768.  
  4769.  See description of PGVSTD.
  4770.  
  4771. %PGVSTD
  4772.  set standard (default) viewport
  4773.      SUBROUTINE PGVSTD
  4774.  
  4775.  Define the viewport to be the standard viewport.  The standard
  4776.  viewport is the full area of the view surface (or panel),
  4777.  less a margin of 4 character heights all round for labelling.
  4778.  It thus depends on the current character size, set by PGSCH.
  4779.  
  4780.  Arguments: none.
  4781.  
  4782. %PGWEDG
  4783.  annotate an image plot with a wedge
  4784.      SUBROUTINE PGWEDG(SIDE, DISP, WIDTH, FG, BG, LABEL)
  4785.      CHARACTER *(*) SIDE,LABEL
  4786.      REAL DISP, WIDTH, FG, BG
  4787.  
  4788.  Plot an annotated grey-scale or color wedge parallel to a given axis
  4789.  of the the current viewport. This routine is designed to provide a
  4790.  brightness/color scale for an image drawn with PGIMAG or PGGRAY.
  4791.  The wedge will be drawn with the transfer function set by PGSITF
  4792.  and using the color index range set by PGSCIR.
  4793.  
  4794.  Arguments:
  4795.   SIDE   (input)  : The first character must be one of the characters
  4796.                     'B', 'L', 'T', or 'R' signifying the Bottom, Left,
  4797.                     Top, or Right edge of the viewport.
  4798.                     The second character should be 'I' to use PGIMAG
  4799.                     to draw the wedge, or 'G' to use PGGRAY.
  4800.   DISP   (input)  : the displacement of the wedge from the specified
  4801.                     edge of the viewport, measured outwards from the
  4802.                     viewport in units of the character height. Use a
  4803.                     negative value to write inside the viewport, a
  4804.                     positive value to write outside.
  4805.   WIDTH  (input)  : The total width of the wedge including annotation,
  4806.                     in units of the character height.
  4807.   FG     (input)  : The value which is to appear with shade
  4808.                     1 ("foreground"). Use the values of FG and BG
  4809.                     that were supplied to PGGRAY or PGIMAG.
  4810.   BG     (input)  : the value which is to appear with shade
  4811.                     0 ("background").
  4812.   LABEL  (input)  : Optional units label. If no label is required
  4813.                     use ' '.
  4814.  
  4815. %PGWINDOW
  4816.  non-standard alias for PGSWIN
  4817.      SUBROUTINE PGWINDOW (X1, X2, Y1, Y2)
  4818.      REAL X1, X2, Y1, Y2
  4819.  
  4820.  See description of PGSWIN.
  4821.  
  4822. %PGWNAD
  4823.  set window and adjust viewport to same aspect ratio
  4824.      SUBROUTINE PGWNAD (X1, X2, Y1, Y2)
  4825.      REAL X1, X2, Y1, Y2
  4826.  
  4827.  Change the window in world coordinate space that is to be mapped on
  4828.  to the viewport, and simultaneously adjust the viewport so that the
  4829.  world-coordinate scales are equal in x and y. The new viewport is
  4830.  the largest one that can fit within the previously set viewport
  4831.  while retaining the required aspect ratio.
  4832.  
  4833.  Arguments:
  4834.   X1     (input)  : the x-coordinate of the bottom left corner
  4835.                     of the viewport.
  4836.   X2     (input)  : the x-coordinate of the top right corner
  4837.                     of the viewport (note X2 may be less than X1).
  4838.   Y1     (input)  : the y-coordinate of the bottom left corner
  4839.                     of the viewport.
  4840.   Y2     (input)  : the y-coordinate of the top right corner of the
  4841.                     viewport (note Y2 may be less than Y1).
  4842.  
  4843.