home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / pgplot5.1 / pgplot5 / pgplot5.1.0 / doc / pgplot.hlp < prev    next >
Encoding:
Text File  |  1996-05-13  |  121.7 KB  |  2,836 lines

  1. 1 PGPLOT
  2.   PGPLOT GRAPHICS SUBROUTINE LIBRARY Version 5.1
  3.  
  4.   PGPLOT is a Fortran subroutine package for drawing graphs on a variety
  5.   of display devices. For more details, see the manual ``PGPLOT Graphics
  6.   Subroutine Library'' available from T. J. Pearson
  7.   (tjp@astro.caltech.edu).
  8.  
  9.   Arguments
  10.  
  11.   The subroutine descriptions indicate the data type of each argument.
  12.   When arguments are described as ``input'', they may be replaced with
  13.   constants or expressions in the CALL statement, but make sure that the
  14.   constant or expression has the correct data type.
  15.    
  16.   INTEGER arguments:
  17.      these should be declared INTEGER or INTEGER*4 in the calling
  18.      program, not INTEGER*2.
  19.           
  20.   REAL arguments:
  21.      these should be declared REAL or REAL*4 in the calling program,
  22.      not REAL*8 or DOUBLE PRECISION.
  23.           
  24.   LOGICAL arguments:
  25.      these should be declared LOGICAL or LOGICAL*4 in the calling
  26.      program.
  27.           
  28.   CHARACTER arguments:
  29.      any valid Fortran CHARACTER variable may be used (declared
  30.      CHARACTER*n for some integer n).
  31.  
  32. 2 PGARRO -- draw an arrow
  33.       SUBROUTINE PGARRO (X1, Y1, X2, Y2)
  34.       REAL X1, Y1, X2, Y2
  35.   
  36.   Draw an arrow from the point with world-coordinates (X1,Y1) to 
  37.   (X2,Y2). The size of the arrowhead at (X2,Y2) is determined by 
  38.   the current character size set by routine PGSCH. The default size 
  39.   is 1/40th of the smaller of the width or height of the view surface.
  40.   The appearance of the arrowhead (shape and solid or open) is
  41.   controlled by routine PGSAH.
  42.   
  43.   Arguments:
  44.    X1, Y1 (input)  : world coordinates of the tail of the arrow.
  45.    X2, Y2 (input)  : world coordinates of the head of the arrow.
  46.  
  47. 2 PGASK -- control new page prompting
  48.       SUBROUTINE PGASK (FLAG)
  49.       LOGICAL FLAG
  50.   
  51.   Change the ``prompt state'' of PGPLOT. If the prompt state is
  52.   ON, PGPAGE will type ``Type RETURN for next page:'' and will wait
  53.   for the user to type a carriage-return before starting a new page.
  54.   The initial prompt state (after a call to PGBEG) is ON for 
  55.   interactive devices. Prompt state is always OFF for non-interactive 
  56.   devices.
  57.   
  58.   Arguments:
  59.    FLAG   (input)  : if .TRUE., and if the device is an interactive
  60.                      device, the prompt state will be set to ON. If
  61.                      .FALSE., the prompt state will be set to OFF.
  62.  
  63. 2 PGBAND -- read cursor position, with anchor
  64.       INTEGER FUNCTION PGBAND (MODE, POSN, XREF, YREF, X, Y, CH)
  65.       INTEGER MODE, POSN
  66.       REAL XREF, YREF, X, Y
  67.       CHARACTER*(*) CH
  68.   
  69.   Read the cursor position and a character typed by the user.
  70.   The position is returned in world coordinates.  PGBAND positions
  71.   the cursor at the position specified (if POSN=1), allows the user to
  72.   move the cursor using the mouse or arrow keys or whatever is available
  73.   on the device. When he has positioned the cursor, the user types a
  74.   single character on the keyboard; PGBAND then returns this
  75.   character and the new cursor position (in world coordinates).
  76.   
  77.   Some interactive devices offer a selection of cursor types,
  78.   implemented as thin lines that move with the cursor, but without
  79.   erasing underlying graphics. Of these types, some extend between
  80.   a stationary anchor-point at XREF,YREF, and the position of the
  81.   cursor, while others simply follow the cursor without changing shape
  82.   or size. The cursor type is specified with one of the following MODE
  83.   values. Cursor types that are not supported by a given device, are
  84.   treated as MODE=0.
  85.   
  86.   -- If MODE=0, the anchor point is ignored and the routine behaves
  87.   like PGCURS.
  88.   -- If MODE=1, a straight line is drawn joining the anchor point 
  89.   and the cursor position.
  90.   -- If MODE=2, a hollow rectangle is extended as the cursor is moved,
  91.   with one vertex at the anchor point and the opposite vertex at the
  92.   current cursor position; the edges of the rectangle are horizontal
  93.   and vertical.
  94.   -- If MODE=3, two horizontal lines are extended across the width of
  95.   the display, one drawn through the anchor point and the other
  96.   through the moving cursor position. This could be used to select
  97.   a Y-axis range when one end of the range is known.
  98.   -- If MODE=4, two vertical lines are extended over the height of
  99.   the display, one drawn through the anchor point and the other
  100.   through the moving cursor position. This could be used to select an
  101.   X-axis range when one end of the range is known.
  102.   -- If MODE=5, a horizontal line is extended through the cursor
  103.   position over the width of the display. This could be used to select
  104.   an X-axis value such as the start of an X-axis range. The anchor point
  105.   is ignored.
  106.   -- If MODE=6, a vertical line is extended through the cursor
  107.   position over the height of the display. This could be used to select
  108.   a Y-axis value such as the start of a Y-axis range. The anchor point
  109.   is ignored.
  110.   -- If MODE=7, a cross-hair, centered on the cursor, is extended over
  111.   the width and height of the display. The anchor point is ignored.
  112.   
  113.   Returns:
  114.    PGBAND          : 1 if the call was successful; 0 if the device
  115.                      has no cursor or some other error occurs.
  116.   Arguments:
  117.    MODE   (input)  : display mode (0, 1, ..7: see above).
  118.    POSN   (input)  : if POSN=1, PGBAND attempts to place the cursor
  119.                      at point (X,Y); if POSN=0, it leaves the cursor
  120.                      at its current position. (On some devices this
  121.                      request may be ignored.)
  122.    XREF   (input)  : the world x-coordinate of the anchor point.
  123.    YREF   (input)  : the world y-coordinate of the anchor point.
  124.    X      (in/out) : the world x-coordinate of the cursor.
  125.    Y      (in/out) : the world y-coordinate of the cursor.
  126.    CH     (output) : the character typed by the user; if the device has
  127.                      no cursor or if some other error occurs, the value
  128.                      CHAR(0) [ASCII NUL character] is returned.
  129.   
  130.   Note: The cursor coordinates (X,Y) may be changed by PGBAND even if
  131.   the device has no cursor or if the user does not move the cursor.
  132.   Under these circumstances, the position returned in (X,Y) is that of
  133.   the pixel nearest to the requested position.
  134.  
  135. 2 PGBBUF -- begin batch of output (buffer)
  136.       SUBROUTINE PGBBUF
  137.   
  138.   Begin saving graphical output commands in an internal buffer; the
  139.   commands are held until a matching PGEBUF call (or until the buffer
  140.   is emptied by PGUPDT). This can greatly improve the efficiency of
  141.   PGPLOT.  PGBBUF increments an internal counter, while PGEBUF
  142.   decrements this counter and flushes the buffer to the output
  143.   device when the counter drops to zero.  PGBBUF and PGEBUF calls
  144.   should always be paired.
  145.   
  146.   Arguments: none
  147.  
  148. 2 PGBEG -- begin PGPLOT, open output device
  149.       INTEGER FUNCTION PGBEG (UNIT, FILE, NXSUB, NYSUB)
  150.       INTEGER       UNIT
  151.       CHARACTER*(*) FILE
  152.       INTEGER       NXSUB, NYSUB
  153.   
  154.   Begin PGPLOT, open the plot file.  A call to PGBEG is
  155.   required before any other calls to PGPLOT subroutines.  If a plot
  156.   file is already open for PGPLOT output, it is closed before the new
  157.   file is opened.
  158.   
  159.   Returns:
  160.    PGBEG         : a status return value. A value of 1 indicates
  161.                      successful completion, any other value indicates
  162.                      an error. In the event of error a message is
  163.                      written on the standard error unit.  
  164.                      To test the return value, call
  165.                      PGBEG as a function, eg IER=PGBEG(...); note
  166.                      that PGBEG must be declared INTEGER in the
  167.                      calling program.
  168.   Arguments:
  169.    UNIT  (input)   : this argument is ignored by PGBEG (use zero).
  170.    FILE  (input)   : the "device specification" for the plot device.
  171.                      Device specifications are installation dependent,
  172.                      but usually have the form "device/type" or
  173.                      "file/type". If this argument is a
  174.                      question mark ('?'), PGBEG will prompt the user
  175.                      to supply a string. If the argument is a blank
  176.                      string (' '), PGBEG will use the value of
  177.                      environment variable PGPLOT_DEV.
  178.    NXSUB  (input)  : the number of subdivisions of the view surface in
  179.                      X (>0 or <0).
  180.    NYSUB  (input)  : the number of subdivisions of the view surface in
  181.                      Y (>0).
  182.                      PGPLOT puts NXSUB x NYSUB graphs on each plot
  183.                      page or screen; when the view surface is sub-
  184.                      divided in this way, PGPAGE moves to the next
  185.                      panel, not the  next physical page. If
  186.                      NXSUB > 0, PGPLOT uses the panels in row
  187.                      order; if <0, PGPLOT uses them in column order.
  188.  
  189. 2 PGBIN -- histogram of binned data
  190.       SUBROUTINE PGBIN (NBIN, X, DATA, CENTER)
  191.       INTEGER NBIN
  192.       REAL X(*), DATA(*)
  193.       LOGICAL CENTER
  194.   
  195.   Plot a histogram of NBIN values with X(1..NBIN) values along
  196.   the ordinate, and DATA(1...NBIN) along the abscissa. Bin width is
  197.   spacing between X values.
  198.   
  199.   Arguments:
  200.    NBIN   (input)  : number of values.
  201.    X      (input)  : abscissae of bins.
  202.    DATA   (input)  : data values of bins.
  203.    CENTER (input)  : if .TRUE., the X values denote the center of the
  204.                      bin; if .FALSE., the X values denote the lower
  205.                      edge (in X) of the bin.
  206.  
  207. 2 PGBOX -- draw labeled frame around viewport
  208.       SUBROUTINE PGBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
  209.       CHARACTER*(*) XOPT, YOPT
  210.       REAL XTICK, YTICK
  211.       INTEGER NXSUB, NYSUB
  212.   
  213.   Annotate the viewport with frame, axes, numeric labels, etc.
  214.   PGBOX is called by on the user's behalf by PGENV, but may also be
  215.   called explicitly.
  216.   
  217.   Arguments:
  218.    XOPT   (input)  : string of options for X (horizontal) axis of
  219.                      plot. Options are single letters, and may be in
  220.                      any order (see below).
  221.    XTICK  (input)  : world coordinate interval between major tick marks
  222.                      on X axis. If XTICK=0.0, the interval is chosen by
  223.                      PGBOX, so that there will be at least 3 major tick
  224.                      marks along the axis.
  225.    NXSUB  (input)  : the number of subintervals to divide the major
  226.                      coordinate interval into. If XTICK=0.0 or NXSUB=0,
  227.                      the number is chosen by PGBOX.
  228.    YOPT   (input)  : string of options for Y (vertical) axis of plot.
  229.                      Coding is the same as for XOPT.
  230.    YTICK  (input)  : like XTICK for the Y axis.
  231.    NYSUB  (input)  : like NXSUB for the Y axis.
  232.   
  233.   Options (for parameters XOPT and YOPT):
  234.    A : draw Axis (X axis is horizontal line Y=0, Y axis is vertical
  235.        line X=0).
  236.    B : draw bottom (X) or left (Y) edge of frame.
  237.    C : draw top (X) or right (Y) edge of frame.
  238.    G : draw Grid of vertical (X) or horizontal (Y) lines.
  239.    I : Invert the tick marks; ie draw them outside the viewport
  240.        instead of inside.
  241.    L : label axis Logarithmically (see below).
  242.    N : write Numeric labels in the conventional location below the
  243.        viewport (X) or to the left of the viewport (Y).
  244.    P : extend ("Project") major tick marks outside the box (ignored if
  245.        option I is specified).
  246.    M : write numeric labels in the unconventional location above the
  247.        viewport (X) or to the right of the viewport (Y).
  248.    T : draw major Tick marks at the major coordinate interval.
  249.    S : draw minor tick marks (Subticks).
  250.    V : orient numeric labels Vertically. This is only applicable to Y.
  251.        The default is to write Y-labels parallel to the axis.
  252.    1 : force decimal labelling, instead of automatic choice (see PGNUMB).
  253.    2 : force exponential labelling, instead of automatic.
  254.   
  255.   To get a complete frame, specify BC in both XOPT and YOPT.
  256.   Tick marks, if requested, are drawn on the axes or frame
  257.   or both, depending which are requested. If none of ABC is specified,
  258.   tick marks will not be drawn. When PGENV calls PGBOX, it sets both
  259.   XOPT and YOPT according to the value of its parameter AXIS:
  260.   -1: 'BC', 0: 'BCNST', 1: 'ABCNST', 2: 'ABCGNST'.
  261.   
  262.   For a logarithmic axis, the major tick interval is always 1.0. The
  263.   numeric label is 10**(x) where x is the world coordinate at the
  264.   tick mark. If subticks are requested, 8 subticks are drawn between
  265.   each major tick at equal logarithmic intervals.
  266.   
  267.   To label an axis with time (days, hours, minutes, seconds) or
  268.   angle (degrees, arcmin, arcsec), use routine PGTBOX.
  269.  
  270. 2 PGCIRC -- draw a filled or outline circle
  271.       SUBROUTINE PGCIRC (XCENT, YCENT, RADIUS)
  272.       REAL XCENT, YCENT, RADIUS
  273.   
  274.   Draw a circle. The action of this routine depends
  275.   on the setting of the Fill-Area Style attribute. If Fill-Area Style
  276.   is SOLID (the default), the interior of the circle is solid-filled
  277.   using the current Color Index. If Fill-Area Style is HOLLOW, the
  278.   outline of the circle is drawn using the current line attributes
  279.   (color index, line-style, and line-width).
  280.   
  281.   Arguments:
  282.    XCENT  (input)  : world x-coordinate of the center of the circle.
  283.    YCENT  (input)  : world y-coordinate of the center of the circle.
  284.    RADIUS (input)  : radius of circle (world coordinates).
  285.  
  286. 2 PGCLOS -- close the selected graphics device
  287.       SUBROUTINE PGCLOS
  288.   
  289.   Close the currently selected graphics device. After the device has
  290.   been closed, either another open device must be selected with PGSLCT
  291.   or another device must be opened with PGOPEN before any further
  292.   plotting can be done. If the call to PGCLOS is omitted, some or all 
  293.   of the plot may be lost.
  294.   
  295.   [This routine was added to PGPLOT in Version 5.1.0. Older programs
  296.   use PGEND instead.]
  297.   
  298.   Arguments: none
  299.  
  300. 2 PGCONB -- contour map of a 2D data array, with blanking
  301.       SUBROUTINE PGCONB (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR, 
  302.      1                   BLANK)
  303.       INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  304.       REAL    A(IDIM,JDIM), C(*), TR(6), BLANK
  305.   
  306.   Draw a contour map of an array. This routine is the same as PGCONS,
  307.   except that array elements that have the "magic value" defined by
  308.   argument BLANK are ignored, making gaps in the contour map. The
  309.   routine may be useful for data measured on most but not all of the
  310.   points of a grid.
  311.   
  312.   Arguments:
  313.    A      (input)  : data array.
  314.    IDIM   (input)  : first dimension of A.
  315.    JDIM   (input)  : second dimension of A.
  316.    I1,I2  (input)  : range of first index to be contoured (inclusive).
  317.    J1,J2  (input)  : range of second index to be contoured (inclusive).
  318.    C      (input)  : array of contour levels (in the same units as the
  319.                      data in array A); dimension at least NC.
  320.    NC     (input)  : number of contour levels (less than or equal to
  321.                      dimension of C). The absolute value of this
  322.                      argument is used (for compatibility with PGCONT,
  323.                      where the sign of NC is significant).
  324.    TR     (input)  : array defining a transformation between the I,J
  325.                      grid of the array and the world coordinates. The
  326.                      world coordinates of the array point A(I,J) are
  327.                      given by:
  328.                        X = TR(1) + TR(2)*I + TR(3)*J
  329.                        Y = TR(4) + TR(5)*I + TR(6)*J
  330.                      Usually TR(3) and TR(5) are zero - unless the
  331.                      coordinate transformation involves a rotation
  332.                      or shear.
  333.    BLANK   (input) : elements of array A that are exactly equal to
  334.                      this value are ignored (blanked).
  335.  
  336. 2 PGCONL -- label contour map of a 2D data array 
  337.       SUBROUTINE PGCONL (A, IDIM, JDIM, I1, I2, J1, J2, C, TR,
  338.      1                   LABEL, INTVAL, MININT)
  339.       INTEGER IDIM, JDIM, I1, J1, I2, J2, INTVAL, MININT
  340.       REAL A(IDIM,JDIM), C, TR(6)
  341.       CHARACTER*(*) LABEL
  342.   
  343.   Label a contour map drawn with routine PGCONT. Routine PGCONT should
  344.   be called first to draw the contour lines, then this routine should be
  345.   called to add the labels. Labels are written at intervals along the
  346.   contour lines, centered on the contour lines with lettering aligned
  347.   in the up-hill direction. Labels are opaque, so a part of the under-
  348.   lying contour line is obscured by the label. Labels use the current
  349.   attributes (character height, line width, color index, character
  350.   font).
  351.   
  352.   The first 9 arguments are the same as those supplied to PGCONT, and
  353.   should normally be identical to those used with PGCONT. Note that
  354.   only one contour level can be specified; tolabel more contours, call
  355.   PGCONL for each level.
  356.   
  357.   The Label is supplied as a character string in argument LABEL.
  358.   
  359.   The spacing of labels along the contour is specified by parameters
  360.   INTVAL and MININT. The routine follows the contour through the
  361.   array, counting the number of cells that the contour crosses. The
  362.   first label will be written in the MININT'th cell, and additional
  363.   labels will be written every INTVAL cells thereafter. A contour
  364.   that crosses less than MININT cells will not be labelled. Some
  365.   experimentation may be needed to get satisfactory results; a good
  366.   place to start is INTVAL=20, MININT=10.
  367.   
  368.   Arguments:
  369.    A      (input) : data array.
  370.    IDIM   (input) : first dimension of A.
  371.    JDIM   (input) : second dimension of A.
  372.    I1, I2 (input) : range of first index to be contoured (inclusive).
  373.    J1, J2 (input) : range of second index to be contoured (inclusive).
  374.    C      (input) : the level of the contour to be labelled (one of the
  375.                     values given to PGCONT).
  376.    TR     (input) : array defining a transformation between the I,J
  377.                     grid of the array and the world coordinates.
  378.                     The world coordinates of the array point A(I,J)
  379.                     are given by:
  380.                       X = TR(1) + TR(2)*I + TR(3)*J
  381.                       Y = TR(4) + TR(5)*I + TR(6)*J
  382.                     Usually TR(3) and TR(5) are zero - unless the
  383.                     coordinate transformation involves a rotation or
  384.                     shear.
  385.    LABEL  (input) : character strings to be used to label the specified
  386.                     contour. Leading and trailing blank spaces are
  387.                     ignored.
  388.    INTVAL (input) : spacing along the contour between labels, in
  389.                     grid cells.
  390.    MININT (input) : contours that cross less than MININT cells
  391.                     will not be labelled.
  392.  
  393. 2 PGCONS -- contour map of a 2D data array (fast algorithm)
  394.       SUBROUTINE PGCONS (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
  395.       INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  396.       REAL    A(IDIM,JDIM), C(*), TR(6)
  397.   
  398.   Draw a contour map of an array. The map is truncated if
  399.   necessary at the boundaries of the viewport.  Each contour line is
  400.   drawn with the current line attributes (color index, style, and
  401.   width).  This routine, unlike PGCONT, does not draw each contour as a
  402.   continuous line, but draws the straight line segments composing each
  403.   contour in a random order.  It is thus not suitable for use on pen
  404.   plotters, and it usually gives unsatisfactory results with dashed or
  405.   dotted lines.  It is, however, faster than PGCONT, especially if
  406.   several contour levels are drawn with one call of PGCONS.
  407.   
  408.   Arguments:
  409.    A      (input)  : data array.
  410.    IDIM   (input)  : first dimension of A.
  411.    JDIM   (input)  : second dimension of A.
  412.    I1,I2  (input)  : range of first index to be contoured (inclusive).
  413.    J1,J2  (input)  : range of second index to be contoured (inclusive).
  414.    C      (input)  : array of contour levels (in the same units as the
  415.                      data in array A); dimension at least NC.
  416.    NC     (input)  : number of contour levels (less than or equal to
  417.                      dimension of C). The absolute value of this
  418.                      argument is used (for compatibility with PGCONT,
  419.                      where the sign of NC is significant).
  420.    TR     (input)  : array defining a transformation between the I,J
  421.                      grid of the array and the world coordinates. The
  422.                      world coordinates of the array point A(I,J) are
  423.                      given by:
  424.                        X = TR(1) + TR(2)*I + TR(3)*J
  425.                        Y = TR(4) + TR(5)*I + TR(6)*J
  426.                      Usually TR(3) and TR(5) are zero - unless the
  427.                      coordinate transformation involves a rotation
  428.                      or shear.
  429.  
  430. 2 PGCONT -- contour map of a 2D data array (contour-following)
  431.       SUBROUTINE PGCONT (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR)
  432.       INTEGER IDIM, JDIM, I1, J1, I2, J2, NC
  433.       REAL A(IDIM,JDIM), C(*), TR(6)
  434.   
  435.   Draw a contour map of an array.  The map is truncated if
  436.   necessary at the boundaries of the viewport.  Each contour line
  437.   is drawn with the current line attributes (color index, style, and
  438.   width); except that if argument NC is positive (see below), the line
  439.   style is set by PGCONT to 1 (solid) for positive contours or 2
  440.   (dashed) for negative contours.
  441.   
  442.   Arguments:
  443.    A      (input) : data array.
  444.    IDIM   (input) : first dimension of A.
  445.    JDIM   (input) : second dimension of A.
  446.    I1, I2 (input) : range of first index to be contoured (inclusive).
  447.    J1, J2 (input) : range of second index to be contoured (inclusive).
  448.    C      (input) : array of NC contour levels; dimension at least NC.
  449.    NC     (input) : +/- number of contour levels (less than or equal
  450.                     to dimension of C). If NC is positive, it is the
  451.                     number of contour levels, and the line-style is
  452.                     chosen automatically as described above. If NC is
  453.                     negative, it is minus the number of contour
  454.                     levels, and the current setting of line-style is
  455.                     used for all the contours.
  456.    TR     (input) : array defining a transformation between the I,J
  457.                     grid of the array and the world coordinates.
  458.                     The world coordinates of the array point A(I,J)
  459.                     are given by:
  460.                       X = TR(1) + TR(2)*I + TR(3)*J
  461.                       Y = TR(4) + TR(5)*I + TR(6)*J
  462.                     Usually TR(3) and TR(5) are zero - unless the
  463.                     coordinate transformation involves a rotation or
  464.                     shear.
  465.  
  466. 2 PGCONX -- contour map of a 2D data array (non rectangular)
  467.       SUBROUTINE PGCONX (A, IDIM, JDIM, I1, I2, J1, J2, C, NC, PLOT)
  468.       INTEGER  IDIM, JDIM, I1, J1, I2, J2, NC
  469.       REAL     A(IDIM,JDIM), C(*)
  470.       EXTERNAL PLOT
  471.   
  472.   Draw a contour map of an array using a user-supplied plotting
  473.   routine.  This routine should be used instead of PGCONT when the
  474.   data are defined on a non-rectangular grid.  PGCONT permits only
  475.   a linear transformation between the (I,J) grid of the array
  476.   and the world coordinate system (x,y), but PGCONX permits any
  477.   transformation to be used, the transformation being defined by a
  478.   user-supplied subroutine. The nature of the contouring algorithm,
  479.   however, dictates that the transformation should maintain the
  480.   rectangular topology of the grid, although grid-points may be
  481.   allowed to coalesce.  As an example of a deformed rectangular
  482.   grid, consider data given on the polar grid theta=0.1n(pi/2),
  483.   for n=0,1,...,10, and r=0.25m, for m=0,1,..,4. This grid
  484.   contains 55 points, of which 11 are coincident at the origin.
  485.   The input array for PGCONX should be dimensioned (11,5), and
  486.   data values should be provided for all 55 elements.  PGCONX can
  487.   also be used for special applications in which the height of the
  488.   contour affects its appearance, e.g., stereoscopic views.
  489.   
  490.   The map is truncated if necessary at the boundaries of the viewport.
  491.   Each contour line is drawn with the current line attributes (color
  492.   index, style, and width); except that if argument NC is positive
  493.   (see below), the line style is set by PGCONX to 1 (solid) for
  494.   positive contours or 2 (dashed) for negative contours. Attributes
  495.   for the contour lines can also be set in the user-supplied
  496.   subroutine, if desired.
  497.   
  498.   Arguments:
  499.    A      (input) : data array.
  500.    IDIM   (input) : first dimension of A.
  501.    JDIM   (input) : second dimension of A.
  502.    I1, I2 (input) : range of first index to be contoured (inclusive).
  503.    J1, J2 (input) : range of second index to be contoured (inclusive).
  504.    C      (input) : array of NC contour levels; dimension at least NC.
  505.    NC     (input) : +/- number of contour levels (less than or equal
  506.                     to dimension of C). If NC is positive, it is the
  507.                     number of contour levels, and the line-style is
  508.                     chosen automatically as described above. If NC is
  509.                     negative, it is minus the number of contour
  510.                     levels, and the current setting of line-style is
  511.                     used for all the contours.
  512.    PLOT   (input) : the address (name) of a subroutine supplied by
  513.                     the user, which will be called by PGCONX to do
  514.                     the actual plotting. This must be declared
  515.                     EXTERNAL in the program unit calling PGCONX.
  516.   
  517.   The subroutine PLOT will be called with four arguments:
  518.        CALL PLOT(VISBLE,X,Y,Z)
  519.   where X,Y (input) are real variables corresponding to
  520.   I,J indices of the array A. If  VISBLE (input, integer) is 1,
  521.   PLOT should draw a visible line from the current pen
  522.   position to the world coordinate point corresponding to (X,Y);
  523.   if it is 0, it should move the pen to (X,Y). Z is the value
  524.   of the current contour level, and may be used by PLOT if desired.
  525.   Example:
  526.         SUBROUTINE PLOT (VISBLE,X,Y,Z)
  527.         REAL X, Y, Z, XWORLD, YWORLD
  528.         INTEGER VISBLE
  529.         XWORLD = X*COS(Y) ! this is the user-defined
  530.         YWORLD = X*SIN(Y) ! transformation
  531.         IF (VISBLE.EQ.0) THEN
  532.             CALL PGMOVE (XWORLD, YWORLD)
  533.         ELSE
  534.             CALL PGDRAW (XWORLD, YWORLD)
  535.         END IF
  536.         END
  537.  
  538. 2 PGCTAB -- install the color table to be used by PGIMAG
  539.       SUBROUTINE PGCTAB(L, R, G, B, NC, CONTRA, BRIGHT)
  540.       INTEGER NC
  541.       REAL    L(NC), R(NC), G(NC), B(NC), CONTRA, BRIGHT
  542.   
  543.   Use the given color table to change the color representations of
  544.   all color indexes marked for use by PGIMAG. To change which
  545.   color indexes are thus marked, call PGSCIR before calling PGCTAB
  546.   or PGIMAG. On devices that can change the color representations
  547.   of previously plotted graphics, PGCTAB will also change the colors
  548.   of existing graphics that were plotted with the marked color
  549.   indexes. This feature can then be combined with PGBAND to
  550.   interactively manipulate the displayed colors of data previously
  551.   plotted with PGIMAG.
  552.   
  553.   Limitations:
  554.    1. Some devices do not propagate color representation changes
  555.       to previously drawn graphics.
  556.    2. Some devices ignore requests to change color representations.
  557.    3. The appearance of specific color representations on grey-scale
  558.       devices is device-dependent.
  559.   
  560.   Arguments:
  561.    L      (input)  : An array of NC normalized ramp-intensity levels
  562.                      corresponding to the RGB primary color intensities
  563.                      in R(),G(),B(). Colors on the ramp are linearly
  564.                      interpolated from neighbouring levels.
  565.                      Levels must be sorted in increasing order.
  566.                       0.0 places a color at the beginning of the ramp.
  567.                       1.0 places a color at the end of the ramp.
  568.                      Colors outside these limits are legal, but will
  569.                      not be visible if CONTRA=1.0 and BRIGHT=0.5.
  570.    R      (input)  : An array of NC normalized red intensities.
  571.    G      (input)  : An array of NC normalized green intensities.
  572.    B      (input)  : An array of NC normalized blue intensities.
  573.    NC     (input)  : The number of color table entries.
  574.    CONTRA (input)  : The contrast of the color ramp (normally 1.0).
  575.    BRIGHT (input)  : Brightness at the center colorindex (normally 0.5).
  576.  
  577. 2 PGCURS -- read cursor position
  578.       INTEGER FUNCTION PGCURS (X, Y, CH)
  579.       REAL X, Y
  580.       CHARACTER*(*) CH
  581.   
  582.   Read the cursor position and a character typed by the user.
  583.   The position is returned in world coordinates.  PGCURS positions
  584.   the cursor at the position specified, allows the user to move the
  585.   cursor using the joystick or arrow keys or whatever is available on
  586.   the device. When he has positioned the cursor, the user types a
  587.   single character on the keyboard; PGCURS then returns this
  588.   character and the new cursor position (in world coordinates).
  589.   
  590.   Returns:
  591.    PGCURS         : 1 if the call was successful; 0 if the device
  592.                      has no cursor or some other error occurs.
  593.   Arguments:
  594.    X      (in/out) : the world x-coordinate of the cursor.
  595.    Y      (in/out) : the world y-coordinate of the cursor.
  596.    CH     (output) : the character typed by the user; if the device has
  597.                      no cursor or if some other error occurs, the value
  598.                      CHAR(0) [ASCII NUL character] is returned.
  599.   
  600.   Note: The cursor coordinates (X,Y) may be changed by PGCURS even if
  601.   the device has no cursor or if the user does not move the cursor.
  602.   Under these circumstances, the position returned in (X,Y) is that of
  603.   the pixel nearest to the requested position.
  604.  
  605. 2 PGDRAW -- draw a line from the current pen position to a point
  606.       SUBROUTINE PGDRAW (X, Y)
  607.       REAL X, Y
  608.   
  609.   Draw a line from the current pen position to the point
  610.   with world-coordinates (X,Y). The line is clipped at the edge of the
  611.   current window. The new pen position is (X,Y) in world coordinates.
  612.   
  613.   Arguments:
  614.    X      (input)  : world x-coordinate of the end point of the line.
  615.    Y      (input)  : world y-coordinate of the end point of the line.
  616.  
  617. 2 PGEBUF -- end batch of output (buffer)
  618.       SUBROUTINE PGEBUF
  619.   
  620.   A call to PGEBUF marks the end of a batch of graphical output begun
  621.   with the last call of PGBBUF.  PGBBUF and PGEBUF calls should always
  622.   be paired. Each call to PGBBUF increments a counter, while each call
  623.   to PGEBUF decrements the counter. When the counter reaches 0, the
  624.   batch of output is written on the output device.
  625.   
  626.   Arguments: none
  627.  
  628. 2 PGEND -- terminate PGPLOT
  629.       SUBROUTINE PGEND
  630.   
  631.   Terminate PGPLOT, close and release any open graphics devices.
  632.   If the call to PGEND is omitted, some or all of any open plots
  633.   may be lost.
  634.   
  635.   Arguments: none
  636.  
  637. 2 PGENV -- set window and viewport and draw labeled frame
  638.       SUBROUTINE PGENV (XMIN, XMAX, YMIN, YMAX, JUST, AXIS)
  639.       REAL XMIN, XMAX, YMIN, YMAX
  640.       INTEGER JUST, AXIS
  641.   
  642.   Set PGPLOT "Plotter Environment".  PGENV establishes the scaling
  643.   for subsequent calls to PGPT, PGLINE, etc.  The plotter is
  644.   advanced to a new page or panel, clearing the screen if necessary.
  645.   If the "prompt state" is ON (see PGASK), confirmation
  646.   is requested from the user before clearing the screen.
  647.   If requested, a box, axes, labels, etc. are drawn according to
  648.   the setting of argument AXIS.
  649.   
  650.   Arguments:
  651.    XMIN   (input)  : the world x-coordinate at the bottom left corner
  652.                      of the viewport.
  653.    XMAX   (input)  : the world x-coordinate at the top right corner
  654.                      of the viewport (note XMAX may be less than XMIN).
  655.    YMIN   (input)  : the world y-coordinate at the bottom left corner
  656.                      of the viewport.
  657.    YMAX   (input)  : the world y-coordinate at the top right corner
  658.                      of the viewport (note YMAX may be less than YMIN).
  659.    JUST   (input)  : if JUST=1, the scales of the x and y axes (in
  660.                      world coordinates per inch) will be equal,
  661.                      otherwise they will be scaled independently.
  662.    AXIS   (input)  : controls the plotting of axes, tick marks, etc:
  663.        AXIS = -2 : draw no box, axes or labels;
  664.        AXIS = -1 : draw box only;
  665.        AXIS =  0 : draw box and label it with coordinates;
  666.        AXIS =  1 : same as AXIS=0, but also draw the
  667.                    coordinate axes (X=0, Y=0);
  668.        AXIS =  2 : same as AXIS=1, but also draw grid lines
  669.                    at major increments of the coordinates;
  670.        AXIS = 10 : draw box and label X-axis logarithmically;
  671.        AXIS = 20 : draw box and label Y-axis logarithmically;
  672.        AXIS = 30 : draw box and label both axes logarithmically.
  673.   
  674.   For other axis options, use routine PGBOX. PGENV can be persuaded to
  675.   call PGBOX with additional axis options by defining an environment
  676.   parameter PGPLOT_ENVOPT containing the required option codes. 
  677.   Examples:
  678.     PGPLOT_ENVOPT=P      ! draw Projecting tick marks
  679.     PGPLOT_ENVOPT=I      ! Invert the tick marks
  680.     PGPLOT_ENVOPT=IV     ! Invert tick marks and label y Vertically
  681.  
  682. 2 PGERAS -- erase all graphics from current page
  683.       SUBROUTINE PGERAS
  684.   
  685.   Erase all graphics from the current page or panel.
  686.   
  687.   Arguments: none
  688.  
  689. 2 PGERRB -- horizontal or vertical error bar
  690.       SUBROUTINE PGERRB (DIR, N, X, Y, E, T)
  691.       INTEGER DIR, N
  692.       REAL X(*), Y(*), E(*)
  693.       REAL T
  694.   
  695.   Plot error bars in the direction specified by DIR.
  696.   This routine draws an error bar only; to mark the data point at
  697.   the start of the error bar, an additional call to PGPT is required.
  698.   
  699.   Arguments:
  700.    DIR    (input)  : direction to plot the error bar relative to
  701.                      the data point. 
  702.                      One-sided error bar:
  703.                        DIR is 1 for +X (X to X+E);
  704.                               2 for +Y (Y to Y+E);
  705.                               3 for -X (X to X-E);
  706.                               4 for -Y (Y to Y-E).
  707.                      Two-sided error bar:
  708.                        DIR is 5 for +/-X (X-E to X+E); 
  709.                               6 for +/-Y (Y-E to Y+E).
  710.    N      (input)  : number of error bars to plot.
  711.    X      (input)  : world x-coordinates of the data.
  712.    Y      (input)  : world y-coordinates of the data.
  713.    E      (input)  : value of error bar distance to be added to the
  714.                      data position in world coordinates.
  715.    T      (input)  : length of terminals to be drawn at the ends
  716.                      of the error bar, as a multiple of the default
  717.                      length; if T = 0.0, no terminals will be drawn.
  718.   
  719.   Note: the dimension of arrays X, Y, and E must be greater
  720.   than or equal to N. If N is 1, X, Y, and E may be scalar
  721.   variables, or expressions.
  722.  
  723. 2 PGERRX -- horizontal error bar
  724.       SUBROUTINE PGERRX (N, X1, X2, Y, T)
  725.       INTEGER N
  726.       REAL X1(*), X2(*), Y(*)
  727.       REAL T
  728.   
  729.   Plot horizontal error bars.
  730.   This routine draws an error bar only; to mark the data point in
  731.   the middle of the error bar, an additional call to PGPT or
  732.   PGERRY is required.
  733.   
  734.   Arguments:
  735.    N      (input)  : number of error bars to plot.
  736.    X1     (input)  : world x-coordinates of lower end of the
  737.                      error bars.
  738.    X2     (input)  : world x-coordinates of upper end of the
  739.                      error bars.
  740.    Y      (input)  : world y-coordinates of the data.
  741.    T      (input)  : length of terminals to be drawn at the ends
  742.                      of the error bar, as a multiple of the default
  743.                      length; if T = 0.0, no terminals will be drawn.
  744.   
  745.   Note: the dimension of arrays X1, X2, and Y must be greater
  746.   than or equal to N. If N is 1, X1, X2, and Y may be scalar
  747.   variables, or expressions, eg:
  748.         CALL PGERRX(1,X-SIGMA,X+SIGMA,Y)
  749.  
  750. 2 PGERRY -- vertical error bar
  751.       SUBROUTINE PGERRY (N, X, Y1, Y2, T)
  752.       INTEGER N
  753.       REAL X(*), Y1(*), Y2(*)
  754.       REAL T
  755.   
  756.   Plot vertical error bars.
  757.   This routine draws an error bar only; to mark the data point in
  758.   the middle of the error bar, an additional call to PGPT or
  759.   PGERRX is required.
  760.   
  761.   Arguments:
  762.    N      (input)  : number of error bars to plot.
  763.    X      (input)  : world x-coordinates of the data.
  764.    Y1     (input)  : world y-coordinates of top end of the
  765.                      error bars.
  766.    Y2     (input)  : world y-coordinates of bottom end of the
  767.                      error bars.
  768.    T      (input)  : length of terminals to be drawn at the ends
  769.                      of the error bar, as a multiple of the default
  770.                      length; if T = 0.0, no terminals will be drawn.
  771.   
  772.   Note: the dimension of arrays X, Y1, and Y2 must be greater
  773.   than or equal to N. If N is 1, X, Y1, and Y2 may be scalar
  774.   variables or expressions, eg:
  775.         CALL PGERRY(1,X,Y+SIGMA,Y-SIGMA)
  776.  
  777. 2 PGETXT -- erase text from graphics display
  778.       SUBROUTINE PGETXT
  779.   
  780.   Some graphics terminals display text (the normal interactive dialog)
  781.   on the same screen as graphics. This routine erases the text from the
  782.   view surface without affecting the graphics. It does nothing on
  783.   devices which do not display text on the graphics screen, and on
  784.   devices which do not have this capability.
  785.   
  786.   Arguments:
  787.    None
  788.  
  789. 2 PGFUNT -- function defined by X = F(T), Y = G(T)
  790.       SUBROUTINE PGFUNT (FX, FY, N, TMIN, TMAX, PGFLAG)
  791.       REAL FX, FY
  792.       EXTERNAL FX, FY
  793.       INTEGER N
  794.       REAL TMIN, TMAX
  795.       INTEGER PGFLAG
  796.   
  797.   Draw a curve defined by parametric equations X = FX(T), Y = FY(T).
  798.   
  799.   Arguments:
  800.    FX     (external real function): supplied by the user, evaluates
  801.                      X-coordinate.
  802.    FY     (external real function): supplied by the user, evaluates
  803.                      Y-coordinate.
  804.    N      (input)  : the number of points required to define the
  805.                      curve. The functions FX and FY will each be
  806.                      called N+1 times.
  807.    TMIN   (input)  : the minimum value for the parameter T.
  808.    TMAX   (input)  : the maximum value for the parameter T.
  809.    PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  810.                      current window and viewport; if PGFLAG = 0,
  811.                      PGENV is called automatically by PGFUNT to
  812.                      start a new plot with automatic scaling.
  813.   
  814.   Note: The functions FX and FY must be declared EXTERNAL in the
  815.   Fortran program unit that calls PGFUNT.
  816.  
  817. 2 PGFUNX -- function defined by Y = F(X)
  818.       SUBROUTINE PGFUNX (FY, N, XMIN, XMAX, PGFLAG)
  819.       REAL FY
  820.       EXTERNAL FY
  821.       INTEGER N
  822.       REAL XMIN, XMAX
  823.       INTEGER PGFLAG
  824.   
  825.   Draw a curve defined by the equation Y = FY(X), where FY is a
  826.   user-supplied subroutine.
  827.   
  828.   Arguments:
  829.    FY     (external real function): supplied by the user, evaluates
  830.                      Y value at a given X-coordinate.
  831.    N      (input)  : the number of points required to define the
  832.                      curve. The function FY will be called N+1 times.
  833.                      If PGFLAG=0 and N is greater than 1000, 1000
  834.                      will be used instead.  If N is less than 1,
  835.                      nothing will be drawn.
  836.    XMIN   (input)  : the minimum value of X.
  837.    XMAX   (input)  : the maximum value of X.
  838.    PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  839.                      current window and viewport; if PGFLAG = 0,
  840.                      PGENV is called automatically by PGFUNX to
  841.                      start a new plot with X limits (XMIN, XMAX)
  842.                      and automatic scaling in Y.
  843.   
  844.   Note: The function FY must be declared EXTERNAL in the Fortran
  845.   program unit that calls PGFUNX.  It has one argument, the
  846.   x-coordinate at which the y value is required, e.g.
  847.     REAL FUNCTION FY(X)
  848.     REAL X
  849.     FY = .....
  850.     END
  851.  
  852. 2 PGFUNY -- function defined by X = F(Y)
  853.       SUBROUTINE PGFUNY (FX, N, YMIN, YMAX, PGFLAG)
  854.       REAL    FX
  855.       EXTERNAL FX
  856.       INTEGER N
  857.       REAL    YMIN, YMAX
  858.       INTEGER PGFLAG
  859.   
  860.   Draw a curve defined by the equation X = FX(Y), where FY is a
  861.   user-supplied subroutine.
  862.   
  863.   Arguments:
  864.    FX     (external real function): supplied by the user, evaluates
  865.                      X value at a given Y-coordinate.
  866.    N      (input)  : the number of points required to define the
  867.                      curve. The function FX will be called N+1 times.
  868.                      If PGFLAG=0 and N is greater than 1000, 1000
  869.                      will be used instead.  If N is less than 1,
  870.                      nothing will be drawn.
  871.    YMIN   (input)  : the minimum value of Y.
  872.    YMAX   (input)  : the maximum value of Y.
  873.    PGFLAG (input)  : if PGFLAG = 1, the curve is plotted in the
  874.                      current window and viewport; if PGFLAG = 0,
  875.                      PGENV is called automatically by PGFUNY to
  876.                      start a new plot with Y limits (YMIN, YMAX)
  877.                      and automatic scaling in X.
  878.   
  879.   Note: The function FX must be declared EXTERNAL in the Fortran
  880.   program unit that calls PGFUNY.  It has one argument, the
  881.   y-coordinate at which the x value is required, e.g.
  882.     REAL FUNCTION FX(Y)
  883.     REAL Y
  884.     FX = .....
  885.     END
  886.  
  887. 2 PGGRAY -- gray-scale map of a 2D data array
  888.       SUBROUTINE PGGRAY (A, IDIM, JDIM, I1, I2, J1, J2,
  889.      1                   FG, BG, TR)
  890.       INTEGER IDIM, JDIM, I1, I2, J1, J2
  891.       REAL    A(IDIM,JDIM), FG, BG, TR(6)
  892.   
  893.   Draw gray-scale map of an array in current window. The subsection
  894.   of the array A defined by indices (I1:I2, J1:J2) is mapped onto
  895.   the view surface world-coordinate system by the transformation
  896.   matrix TR. The resulting quadrilateral region is clipped at the edge
  897.   of the window and shaded with the shade at each point determined
  898.   by the corresponding array value.  The shade is a number in the
  899.   range 0 to 1 obtained by linear interpolation between the background
  900.   level (BG) and the foreground level (FG), i.e.,
  901.   
  902.     shade = [A(i,j) - BG] / [FG - BG]
  903.   
  904.   The background level BG can be either less than or greater than the
  905.   foreground level FG.  Points in the array that are outside the range
  906.   BG to FG are assigned shade 0 or 1 as appropriate.
  907.   
  908.   PGGRAY uses two different algorithms, depending how many color
  909.   indices are available in the color index range specified for images.
  910.   (This range is set with routine PGSCIR, and the current or default
  911.   range can be queried by calling routine PGQCIR).
  912.   
  913.   If 16 or more color indices are available, PGGRAY first assigns
  914.   color representations to these color indices to give a linear ramp
  915.   between the background color (color index 0) and the foreground color
  916.   (color index 1), and then calls PGIMAG to draw the image using these
  917.   color indices. In this mode, the shaded region is "opaque": every
  918.   pixel is assigned a color.
  919.   
  920.   If less than 16 color indices are available, PGGRAY uses only
  921.   color index 1, and uses  a "dithering" algorithm to fill in pixels,
  922.   with the shade (computed as above) determining the faction of pixels
  923.   that are filled. In this mode the shaded region is "transparent" and
  924.   allows previously-drawn graphics to show through.
  925.   
  926.   The transformation matrix TR is used to calculate the world
  927.   coordinates of the center of the "cell" that represents each
  928.   array element. The world coordinates of the center of the cell
  929.   corresponding to array element A(I,J) are given by:
  930.   
  931.            X = TR(1) + TR(2)*I + TR(3)*J
  932.            Y = TR(4) + TR(5)*I + TR(6)*J
  933.   
  934.   Usually TR(3) and TR(5) are zero -- unless the coordinate
  935.   transformation involves a rotation or shear.  The corners of the
  936.   quadrilateral region that is shaded by PGGRAY are given by
  937.   applying this transformation to (I1-0.5,J1-0.5), (I2+0.5, J2+0.5).
  938.   
  939.   Arguments:
  940.    A      (input)  : the array to be plotted.
  941.    IDIM   (input)  : the first dimension of array A.
  942.    JDIM   (input)  : the second dimension of array A.
  943.    I1, I2 (input)  : the inclusive range of the first index
  944.                      (I) to be plotted.
  945.    J1, J2 (input)  : the inclusive range of the second
  946.                      index (J) to be plotted.
  947.    FG     (input)  : the array value which is to appear with the
  948.                      foreground color (corresponding to color index 1).
  949.    BG     (input)  : the array value which is to appear with the
  950.                      background color (corresponding to color index 0).
  951.    TR     (input)  : transformation matrix between array grid and
  952.                      world coordinates.
  953.  
  954. 2 PGHI2D -- cross-sections through a 2D data array
  955.       SUBROUTINE PGHI2D (DATA, NXV, NYV, IX1, IX2, IY1, IY2, X, IOFF,
  956.      1                   BIAS, CENTER, YLIMS)
  957.       INTEGER NXV, NYV, IX1, IX2, IY1, IY2
  958.       REAL    DATA(NXV,NYV)
  959.       REAL    X(IX2-IX1+1), YLIMS(IX2-IX1+1)
  960.       INTEGER IOFF
  961.       REAL    BIAS
  962.       LOGICAL CENTER
  963.   
  964.   Plot a series of cross-sections through a 2D data array.
  965.   Each cross-section is plotted as a hidden line histogram.  The plot
  966.   can be slanted to give a pseudo-3D effect - if this is done, the
  967.   call to PGENV may have to be changed to allow for the increased X
  968.   range that will be needed.
  969.   
  970.   Arguments:
  971.    DATA   (input)  : the data array to be plotted.
  972.    NXV    (input)  : the first dimension of DATA.
  973.    NYV    (input)  : the second dimension of DATA.
  974.    IX1    (input)
  975.    IX2    (input)
  976.    IY1    (input)
  977.    IY2    (input)  : PGHI2D plots a subset of the input array DATA.
  978.                      This subset is delimited in the first (x)
  979.                      dimension by IX1 and IX2 and the 2nd (y) by IY1
  980.                      and IY2, inclusively. Note: IY2 < IY1 is
  981.                      permitted, resulting in a plot with the
  982.                      cross-sections plotted in reverse Y order.
  983.                      However, IX2 must be => IX1.
  984.    X      (input)  : the abscissae of the bins to be plotted. That is,
  985.                      X(1) should be the X value for DATA(IX1,IY1), and
  986.                      X should have (IX2-IX1+1) elements.  The program
  987.                      has to assume that the X value for DATA(x,y) is
  988.                      the same for all y.
  989.    IOFF   (input)  : an offset in array elements applied to successive
  990.                      cross-sections to produce a slanted effect.  A
  991.                      plot with IOFF > 0 slants to the right, one with
  992.                      IOFF < 0 slants left.
  993.    BIAS   (input)  : a bias value applied to each successive cross-
  994.                      section in order to raise it above the previous
  995.                      cross-section.  This is in the same units as the
  996.                      data.
  997.    CENTER (input)  : if .true., the X values denote the center of the
  998.                      bins; if .false. the X values denote the lower
  999.                      edges (in X) of the bins.
  1000.    YLIMS  (input)  : workspace.  Should be an array of at least
  1001.                      (IX2-IX1+1) elements.
  1002.  
  1003. 2 PGHIST -- histogram of unbinned data
  1004.       SUBROUTINE PGHIST(N, DATA, DATMIN, DATMAX, NBIN, PGFLAG)
  1005.       INTEGER N
  1006.       REAL    DATA(*)
  1007.       REAL    DATMIN, DATMAX
  1008.       INTEGER NBIN, PGFLAG
  1009.   
  1010.   Draw a histogram of N values of a variable in array
  1011.   DATA(1...N) in the range DATMIN to DATMAX using NBIN bins.  Note
  1012.   that array elements which fall exactly on the boundary between
  1013.   two bins will be counted in the higher bin rather than the
  1014.   lower one; and array elements whose value is less than DATMIN or
  1015.   greater than or equal to DATMAX will not be counted at all.
  1016.   
  1017.   Arguments:
  1018.    N      (input)  : the number of data values.
  1019.    DATA   (input)  : the data values. Note: the dimension of array
  1020.                      DATA must be greater than or equal to N. The
  1021.                      first N elements of the array are used.
  1022.    DATMIN (input)  : the minimum data value for the histogram.
  1023.    DATMAX (input)  : the maximum data value for the histogram.
  1024.    NBIN   (input)  : the number of bins to use: the range DATMIN to
  1025.                      DATMAX is divided into NBIN equal bins and
  1026.                      the number of DATA values in each bin is
  1027.                      determined by PGHIST.  NBIN may not exceed 200.
  1028.    PGFLAG (input)  : if PGFLAG = 1, the histogram is plotted in the
  1029.                      current window and viewport; if PGFLAG = 0,
  1030.                      PGENV is called automatically by PGHIST to start
  1031.                      a new plot (the x-limits of the window will be
  1032.                      DATMIN and DATMAX; the y-limits will be chosen
  1033.                      automatically.
  1034.                      IF PGFLAG = 2,3 the histogram will be in the same
  1035.                      window and viewport but with a filled area style.
  1036.                      If pgflag=4,5 as for pgflag = 0,1, but simple
  1037.                      line drawn as for PGBIN
  1038.   
  1039.  
  1040. 2 PGIDEN -- write username, date, and time at bottom of plot
  1041.       SUBROUTINE PGIDEN
  1042.   
  1043.   Write username, date, and time at bottom of plot.
  1044.   
  1045.   Arguments: none.
  1046.  
  1047. 2 PGIMAG -- color image from a 2D data array
  1048.       SUBROUTINE PGIMAG (A, IDIM, JDIM, I1, I2, J1, J2,
  1049.      1                   A1, A2, TR)
  1050.       INTEGER IDIM, JDIM, I1, I2, J1, J2
  1051.       REAL    A(IDIM,JDIM), A1, A2, TR(6)
  1052.   
  1053.   Draw a color image of an array in current window. The subsection
  1054.   of the array A defined by indices (I1:I2, J1:J2) is mapped onto
  1055.   the view surface world-coordinate system by the transformation
  1056.   matrix TR. The resulting quadrilateral region is clipped at the edge
  1057.   of the window. Each element of the array is represented in the image
  1058.   by a small quadrilateral, which is filled with a color specified by
  1059.   the corresponding array value.
  1060.   
  1061.   The subroutine uses color indices in the range C1 to C2, which can
  1062.   be specified by calling PGSCIR before PGIMAG. The default values
  1063.   for C1 and C2 are device-dependent; these values can be determined by
  1064.   calling PGQCIR. Note that color representations should be assigned to
  1065.   color indices C1 to C2 by calling PGSCR before calling PGIMAG. On some
  1066.   devices (but not all), the color representation can be changed after
  1067.   the call to PGIMAG by calling PGSCR again.
  1068.   
  1069.   Array values in the range A1 to A2 are mapped on to the range of
  1070.   color indices C1 to C2, with array values <= A1 being given color
  1071.   index C1 and values >= A2 being given color index C2. The mapping
  1072.   function for intermediate array values can be specified by
  1073.   calling routine PGSITF before PGIMAG; the default is linear.
  1074.   
  1075.   On devices which have no available color indices (C1 > C2),
  1076.   PGIMAG will return without doing anything. On devices with only
  1077.   one color index (C1=C2), all array values map to the same color
  1078.   which is rather uninteresting. An image is always "opaque",
  1079.   i.e., it obscures all graphical elements previously drawn in
  1080.   the region.
  1081.   
  1082.   The transformation matrix TR is used to calculate the world
  1083.   coordinates of the center of the "cell" that represents each
  1084.   array element. The world coordinates of the center of the cell
  1085.   corresponding to array element A(I,J) are given by:
  1086.   
  1087.            X = TR(1) + TR(2)*I + TR(3)*J
  1088.            Y = TR(4) + TR(5)*I + TR(6)*J
  1089.   
  1090.   Usually TR(3) and TR(5) are zero -- unless the coordinate
  1091.   transformation involves a rotation or shear.  The corners of the
  1092.   quadrilateral region that is shaded by PGIMAG are given by
  1093.   applying this transformation to (I1-0.5,J1-0.5), (I2+0.5, J2+0.5).
  1094.   
  1095.   Arguments:
  1096.    A      (input)  : the array to be plotted.
  1097.    IDIM   (input)  : the first dimension of array A.
  1098.    JDIM   (input)  : the second dimension of array A.
  1099.    I1, I2 (input)  : the inclusive range of the first index
  1100.                      (I) to be plotted.
  1101.    J1, J2 (input)  : the inclusive range of the second
  1102.                      index (J) to be plotted.
  1103.    A1     (input)  : the array value which is to appear with shade C1.
  1104.    A2     (input)  : the array value which is to appear with shade C2.
  1105.    TR     (input)  : transformation matrix between array grid and
  1106.                      world coordinates.
  1107.  
  1108. 2 PGLAB -- write labels for x-axis, y-axis, and top of plot
  1109.       SUBROUTINE PGLAB (XLBL, YLBL, TOPLBL)
  1110.       CHARACTER*(*) XLBL, YLBL, TOPLBL
  1111.   
  1112.   Write labels outside the viewport. This routine is a simple
  1113.   interface to PGMTXT, which should be used if PGLAB is inadequate.
  1114.   
  1115.   Arguments:
  1116.    XLBL   (input) : a label for the x-axis (centered below the
  1117.                     viewport).
  1118.    YLBL   (input) : a label for the y-axis (centered to the left
  1119.                     of the viewport, drawn vertically).
  1120.    TOPLBL (input) : a label for the entire plot (centered above the
  1121.                     viewport).
  1122.  
  1123. 2 PGLCUR -- draw a line using the cursor
  1124.       SUBROUTINE PGLCUR (MAXPT, NPT, X, Y)
  1125.       INTEGER MAXPT, NPT
  1126.       REAL    X(*), Y(*)
  1127.   
  1128.   Interactive routine for user to enter a polyline by use of
  1129.   the cursor.  Routine allows user to Add and Delete vertices;
  1130.   vertices are joined by straight-line segments.
  1131.   
  1132.   Arguments:
  1133.    MAXPT  (input)  : maximum number of points that may be accepted.
  1134.    NPT    (in/out) : number of points entered; should be zero on
  1135.                      first call.
  1136.    X      (in/out) : array of x-coordinates (dimension at least MAXPT).
  1137.    Y      (in/out) : array of y-coordinates (dimension at least MAXPT).
  1138.   
  1139.   Notes:
  1140.   
  1141.   (1) On return from the program, cursor points are returned in
  1142.   the order they were entered. Routine may be (re-)called with points
  1143.   already defined in X,Y (# in NPT), and they will be plotted
  1144.   first, before editing.
  1145.   
  1146.   (2) User commands: the user types single-character commands
  1147.   after positioning the cursor: the following are accepted:
  1148.     A (Add)    - add point at current cursor location.
  1149.     D (Delete) - delete last-entered point.
  1150.     X (eXit)   - leave subroutine.
  1151.  
  1152. 2 PGLDEV -- list available device types
  1153.       SUBROUTINE PGLDEV
  1154.   
  1155.   Writes a list to the terminal of all device types known to the
  1156.   current version of PGPLOT.
  1157.   
  1158.   Arguments: none.
  1159.  
  1160. 2 PGLEN -- find length of a string in a variety of units
  1161.       SUBROUTINE PGLEN (UNITS, STRING, XL, YL)
  1162.       REAL XL, YL
  1163.       INTEGER UNITS
  1164.       CHARACTER*(*) STRING
  1165.   
  1166.   Work out length of a string in x and y directions 
  1167.   
  1168.   Input
  1169.    UNITS    :  0 => answer in normalized device coordinates
  1170.                1 => answer in inches
  1171.                2 => answer in mm
  1172.                3 => answer in absolute device coordinates (dots)
  1173.                4 => answer in world coordinates
  1174.                5 => answer as a fraction of the current viewport size
  1175.   
  1176.    STRING   :  String of interest
  1177.   Output
  1178.    XL       :  Length of string in x direction
  1179.    YL       :  Length of string in y direction
  1180.   
  1181.  
  1182. 2 PGLINE -- draw a polyline (curve defined by line-segments)
  1183.       SUBROUTINE PGLINE (N, XPTS, YPTS)
  1184.       INTEGER  N
  1185.       REAL     XPTS(*), YPTS(*)
  1186.   
  1187.   Primitive routine to draw a Polyline. A polyline is one or more
  1188.   connected straight-line segments.  The polyline is drawn using
  1189.   the current setting of attributes color-index, line-style, and
  1190.   line-width. The polyline is clipped at the edge of the window.
  1191.   
  1192.   Arguments:
  1193.    N      (input)  : number of points defining the line; the line
  1194.                      consists of (N-1) straight-line segments.
  1195.                      N should be greater than 1 (if it is 1 or less,
  1196.                      nothing will be drawn).
  1197.    XPTS   (input)  : world x-coordinates of the points.
  1198.    YPTS   (input)  : world y-coordinates of the points.
  1199.   
  1200.   The dimension of arrays X and Y must be greater than or equal to N.
  1201.   The "pen position" is changed to (X(N),Y(N)) in world coordinates
  1202.   (if N > 1).
  1203.  
  1204. 2 PGMOVE -- move pen (change current pen position)
  1205.       SUBROUTINE PGMOVE (X, Y)
  1206.       REAL X, Y
  1207.   
  1208.   Primitive routine to move the "pen" to the point with world
  1209.   coordinates (X,Y). No line is drawn.
  1210.   
  1211.   Arguments:
  1212.    X      (input)  : world x-coordinate of the new pen position.
  1213.    Y      (input)  : world y-coordinate of the new pen position.
  1214.  
  1215. 2 PGMTXT -- write text at position relative to viewport
  1216.       SUBROUTINE PGMTXT (SIDE, DISP, COORD, FJUST, TEXT)
  1217.       CHARACTER*(*) SIDE, TEXT
  1218.       REAL DISP, COORD, FJUST
  1219.   
  1220.   Write text at a position specified relative to the viewport (outside
  1221.   or inside).  This routine is useful for annotating graphs. It is used
  1222.   by routine PGLAB.  The text is written using the current values of
  1223.   attributes color-index, line-width, character-height, and
  1224.   character-font.
  1225.   
  1226.   Arguments:
  1227.    SIDE   (input)  : must include one of the characters 'B', 'L', 'T',
  1228.                      or 'R' signifying the Bottom, Left, Top, or Right
  1229.                      margin of the viewport. If it includes 'LV' or
  1230.                      'RV', the string is written perpendicular to the
  1231.                      frame rather than parallel to it.
  1232.    DISP   (input)  : the displacement of the character string from the
  1233.                      specified edge of the viewport, measured outwards
  1234.                      from the viewport in units of the character
  1235.                      height. Use a negative value to write inside the
  1236.                      viewport, a positive value to write outside.
  1237.    COORD  (input)  : the location of the character string along the
  1238.                      specified edge of the viewport, as a fraction of
  1239.                      the length of the edge.
  1240.    FJUST  (input)  : controls justification of the string parallel to
  1241.                      the specified edge of the viewport. If
  1242.                      FJUST = 0.0, the left-hand end of the string will
  1243.                      be placed at COORD; if JUST = 0.5, the center of
  1244.                      the string will be placed at COORD; if JUST = 1.0,
  1245.                      the right-hand end of the string will be placed at
  1246.                      at COORD. Other values between 0 and 1 give inter-
  1247.                      mediate placing, but they are not very useful.
  1248.    TEXT   (input) :  the text string to be plotted. Trailing spaces are
  1249.                      ignored when justifying the string, but leading
  1250.                      spaces are significant.
  1251.   
  1252.  
  1253. 2 PGNCUR -- mark a set of points using the cursor
  1254.       SUBROUTINE PGNCUR (MAXPT, NPT, X, Y, SYMBOL)
  1255.       INTEGER MAXPT, NPT
  1256.       REAL    X(*), Y(*)
  1257.       INTEGER SYMBOL
  1258.   
  1259.   Interactive routine for user to enter data points by use of
  1260.   the cursor.  Routine allows user to Add and Delete points.  The
  1261.   points are returned in order of increasing x-coordinate, not in the
  1262.   order they were entered.
  1263.   
  1264.   Arguments:
  1265.    MAXPT  (input)  : maximum number of points that may be accepted.
  1266.    NPT    (in/out) : number of points entered; should be zero on
  1267.                      first call.
  1268.    X      (in/out) : array of x-coordinates.
  1269.    Y      (in/out) : array of y-coordinates.
  1270.    SYMBOL (input)  : code number of symbol to use for marking
  1271.                      entered points (see PGPT).
  1272.   
  1273.   Note (1): The dimension of arrays X and Y must be greater than or
  1274.   equal to MAXPT.
  1275.   
  1276.   Note (2): On return from the program, cursor points are returned in
  1277.   increasing order of X. Routine may be (re-)called with points
  1278.   already defined in X,Y (number in NPT), and they will be plotted
  1279.   first, before editing.
  1280.   
  1281.   Note (3): User commands: the user types single-character commands
  1282.   after positioning the cursor: the following are accepted:
  1283.   A (Add)    - add point at current cursor location.
  1284.   D (Delete) - delete nearest point to cursor.
  1285.   X (eXit)   - leave subroutine.
  1286.  
  1287. 2 PGNUMB -- convert a number into a plottable character string
  1288.       SUBROUTINE PGNUMB (MM, PP, FORM, STRING, NC)
  1289.       INTEGER MM, PP, FORM
  1290.       CHARACTER*(*) STRING
  1291.       INTEGER NC
  1292.   
  1293.   This routine converts a number into a decimal character
  1294.   representation. To avoid problems of floating-point roundoff, the
  1295.   number must be provided as an integer (MM) multiplied by a power of 10
  1296.   (10**PP).  The output string retains only significant digits of MM,
  1297.   and will be in either integer format (123), decimal format (0.0123),
  1298.   or exponential format (1.23x10**5). Standard escape sequences \u, \d 
  1299.   raise the exponent and \x is used for the multiplication sign.
  1300.   This routine is used by PGBOX to create numeric labels for a plot.
  1301.   
  1302.   Formatting rules:
  1303.     (a) Decimal notation (FORM=1):
  1304.         - Trailing zeros to the right of the decimal sign are
  1305.           omitted
  1306.         - The decimal sign is omitted if there are no digits
  1307.           to the right of it
  1308.         - When the decimal sign is placed before the first digit
  1309.           of the number, a zero is placed before the decimal sign
  1310.         - The decimal sign is a period (.)
  1311.         - No spaces are placed between digits (ie digits are not
  1312.           grouped in threes as they should be)
  1313.         - A leading minus (-) is added if the number is negative
  1314.     (b) Exponential notation (FORM=2):
  1315.         - The exponent is adjusted to put just one (non-zero)
  1316.           digit before the decimal sign
  1317.         - The mantissa is formatted as in (a), unless its value is
  1318.           1 in which case it and the multiplication sign are omitted
  1319.         - If the power of 10 is not zero and the mantissa is not
  1320.           zero, an exponent of the form \x10\u[-]nnn is appended,
  1321.           where \x is a multiplication sign (cross), \u is an escape
  1322.           sequence to raise the exponent, and as many digits nnn
  1323.           are used as needed
  1324.     (c) Automatic choice (FORM=0):
  1325.           Decimal notation is used if the absolute value of the
  1326.           number is less than 10000 or greater than or equal to
  1327.           0.01. Otherwise exponential notation is used.
  1328.   
  1329.   Arguments:
  1330.    MM     (input)
  1331.    PP     (input)  : the value to be formatted is MM*10**PP.
  1332.    FORM   (input)  : controls how the number is formatted:
  1333.                      FORM = 0 -- use either decimal or exponential
  1334.                      FORM = 1 -- use decimal notation
  1335.                      FORM = 2 -- use exponential notation
  1336.    STRING (output) : the formatted character string, left justified.
  1337.                      If the length of STRING is insufficient, a single
  1338.                      asterisk is returned, and NC=1.
  1339.    NC     (output) : the number of characters used in STRING:
  1340.                      the string to be printed is STRING(1:NC).
  1341.  
  1342. 2 PGOLIN -- mark a set of points using the cursor
  1343.       SUBROUTINE PGOLIN (MAXPT, NPT, X, Y, SYMBOL)
  1344.       INTEGER MAXPT, NPT
  1345.       REAL    X(*), Y(*)
  1346.       INTEGER SYMBOL
  1347.   
  1348.   Interactive routine for user to enter data points by use of
  1349.   the cursor.  Routine allows user to Add and Delete points.  The
  1350.   points are returned in the order that they were entered (unlike
  1351.   PGNCUR).
  1352.   
  1353.   Arguments:
  1354.    MAXPT  (input)  : maximum number of points that may be accepted.
  1355.    NPT    (in/out) : number of points entered; should be zero on
  1356.                      first call.
  1357.    X      (in/out) : array of x-coordinates.
  1358.    Y      (in/out) : array of y-coordinates.
  1359.    SYMBOL (input)  : code number of symbol to use for marking
  1360.                      entered points (see PGPT).
  1361.   
  1362.   Note (1): The dimension of arrays X and Y must be greater than or
  1363.   equal to MAXPT.
  1364.   
  1365.   Note (2): On return from the program, cursor points are returned in
  1366.   the order they were entered. Routine may be (re-)called with points
  1367.   already defined in X,Y (number in NPT), and they will be plotted
  1368.   first, before editing.
  1369.   
  1370.   Note (3): User commands: the user types single-character commands
  1371.   after positioning the cursor: the following are accepted:
  1372.   A (Add)    - add point at current cursor location.
  1373.   D (Delete) - delete the last point entered.
  1374.   X (eXit)   - leave subroutine.
  1375.  
  1376. 2 PGOPEN -- open a graphics device
  1377.       INTEGER FUNCTION PGOPEN (DEVICE)
  1378.       CHARACTER*(*) DEVICE
  1379.   
  1380.   Open a graphics device for PGPLOT output. If the device is
  1381.   opened successfully, it becomes the selected device to which
  1382.   graphics output is directed until another device is selected
  1383.   with PGSLCT or the device is closed with PGCLOS.
  1384.   
  1385.   The value returned by PGOPEN should be tested to ensure that
  1386.   the device was opened successfully, e.g.,
  1387.   
  1388.         ISTAT = PGOPEN('plot.ps/PS')
  1389.         IF (ISTAT .LE. 0 ) STOP
  1390.   
  1391.   Note that PGOPEN must be declared INTEGER in the calling program.
  1392.   
  1393.   [This routine was added to PGPLOT in Version 5.1.0. Older programs
  1394.   use PGBEG instead.]
  1395.   
  1396.   Returns:
  1397.    PGOPEN          : returns either a positive value, the
  1398.                      identifier of the graphics device for use with
  1399.                      PGSLCT, or a 0 or negative value indicating an
  1400.                      error. In the event of error a message is
  1401.                      written on the standard error unit.
  1402.   Arguments:
  1403.    DEVICE  (input) : the "device specification" for the plot device.
  1404.                      Device specifications are installation dependent,
  1405.                      but usually have the form "device/type" or
  1406.                      "file/type". If this argument is a
  1407.                      question mark ('?'), PGOPEN will prompt the user
  1408.                      to supply a string. If the argument is a blank
  1409.                      string (' '), PGOPEN will use the value of
  1410.                      environment variable PGPLOT_DEV.
  1411.  
  1412. 2 PGPAGE -- advance to new page
  1413.       SUBROUTINE PGPAGE
  1414.   
  1415.   Advance plotter to a new page or panel, clearing the screen if
  1416.   necessary. If the "prompt state" is ON (see PGASK), confirmation is
  1417.   requested from the user before clearing the screen. If the view
  1418.   surface has been subdivided into panels with PGBEG or PGSUBP, then
  1419.   PGPAGE advances to the next panel, and if the current panel is the
  1420.   last on the page, PGPAGE clears the screen or starts a new sheet of
  1421.   paper.  PGPAGE does not change the PGPLOT window or the viewport
  1422.   (in normalized device coordinates); but note that if the size of the
  1423.   view-surface is changed externally (e.g., by a workstation window
  1424.   manager) the size of the viewport is chnaged in proportion.
  1425.   
  1426.   Arguments: none
  1427.  
  1428. 2 PGPANL -- switch to a different panel on the view surface
  1429.       SUBROUTINE PGPANL(IX, IY)
  1430.       INTEGER IX, IY
  1431.   
  1432.   Start plotting in a different panel. If the view surface has been
  1433.   divided into panels by PGBEG or PGSUBP, this routine can be used to
  1434.   move to a different panel. Note that PGPLOT does not remember what
  1435.   viewport and window were in use in each panel; these should be reset
  1436.   if necessary after calling PGPANL. Nor does PGPLOT clear the panel:
  1437.   call PGERAS after calling PGPANL to do this.
  1438.   
  1439.   Arguments:
  1440.    IX     (input)  : the horizontal index of the panel (in the range
  1441.                      1 <= IX <= number of panels in horizontal
  1442.                      direction).
  1443.    IY     (input)  : the vertical index of the panel (in the range
  1444.                      1 <= IY <= number of panels in horizontal
  1445.                      direction).
  1446.  
  1447. 2 PGPAP -- change the size of the view surface 
  1448.       SUBROUTINE PGPAP (WIDTH, ASPECT)
  1449.       REAL WIDTH, ASPECT
  1450.   
  1451.   This routine changes the size of the view surface ("paper size") to a
  1452.   specified width and aspect ratio (height/width), in so far as this is
  1453.   possible on the specific device. It is always possible to obtain a
  1454.   view surface smaller than the default size; on some devices (e.g.,
  1455.   printers that print on roll or fan-feed paper) it is possible to 
  1456.   obtain a view surface larger than the default.
  1457.   
  1458.   This routine should be called either immediately after PGBEG or
  1459.   immediately before PGPAGE. The new size applies to all subsequent
  1460.   images until the next call to PGPAP.
  1461.   
  1462.   Arguments:
  1463.    WIDTH  (input)  : the requested width of the view surface in inches;
  1464.                      if WIDTH=0.0, PGPAP will obtain the largest view
  1465.                      surface available consistent with argument ASPECT.
  1466.                      (1 inch = 25.4 mm.)
  1467.    ASPECT (input)  : the aspect ratio (height/width) of the view
  1468.                      surface; e.g., ASPECT=1.0 gives a square view
  1469.                      surface, ASPECT=0.618 gives a horizontal
  1470.                      rectangle, ASPECT=1.618 gives a vertical rectangle.
  1471.  
  1472. 2 PGPIXL -- draw pixels
  1473.       SUBROUTINE PGPIXL (IA, IDIM, JDIM, I1, I2, J1, J2, 
  1474.      1                   X1, X2, Y1, Y2)
  1475.       INTEGER IDIM, JDIM, I1, I2, J1, J2
  1476.       INTEGER IA(IDIM,JDIM)
  1477.       REAL    X1, X2, Y1, Y2
  1478.   
  1479.   Draw lots of solid-filled (tiny) rectangles aligned with the
  1480.   coordinate axes. Best performance is achieved when output is
  1481.   directed to a pixel-oriented device and the rectangles coincide
  1482.   with the pixels on the device. In other cases, pixel output is
  1483.   emulated.
  1484.   
  1485.   The subsection of the array IA defined by indices (I1:I2, J1:J2)
  1486.   is mapped onto world-coordinate rectangle defined by X1, X2, Y1
  1487.   and Y2. This rectangle is divided into (I2 - I1 + 1) * (J2 - J1 + 1)
  1488.   small rectangles. Each of these small rectangles is solid-filled
  1489.   with the color index specified by the corresponding element of 
  1490.   IA.
  1491.   
  1492.   On most devices, the output region is "opaque", i.e., it obscures
  1493.   all graphical elements previously drawn in the region. But on
  1494.   devices that do not have erase capability, the background shade
  1495.   is "transparent" and allows previously-drawn graphics to show
  1496.   through.
  1497.   
  1498.   Arguments:
  1499.    IA     (input)  : the array to be plotted.
  1500.    IDIM   (input)  : the first dimension of array A.
  1501.    JDIM   (input)  : the second dimension of array A.
  1502.    I1, I2 (input)  : the inclusive range of the first index
  1503.                      (I) to be plotted.
  1504.    J1, J2 (input)  : the inclusive range of the second
  1505.                      index (J) to be plotted.
  1506.    X1, Y1 (input)  : world coordinates of one corner of the output
  1507.                      region
  1508.    X2, Y2 (input)  : world coordinates of the opposite corner of the
  1509.                      output region
  1510.  
  1511. 2 PGPNTS -- draw one or more graph markers, not all the same
  1512.       SUBROUTINE PGPNTS (N, X, Y, SYMBOL, NS)
  1513.       INTEGER N, NS
  1514.       REAL X(*), Y(*)
  1515.       INTEGER SYMBOL(*)
  1516.   
  1517.   Draw Graph Markers. Unlike PGPT, this routine can draw a different
  1518.   symbol at each point. The markers
  1519.   are drawn using the current values of attributes color-index,
  1520.   line-width, and character-height (character-font applies if the symbol
  1521.   number is >31).  If the point to be marked lies outside the window,
  1522.   no marker is drawn.  The "pen position" is changed to
  1523.   (XPTS(N),YPTS(N)) in world coordinates (if N > 0).
  1524.   
  1525.   Arguments:
  1526.    N      (input)  : number of points to mark.
  1527.    X      (input)  : world x-coordinate of the points.
  1528.    Y      (input)  : world y-coordinate of the points.
  1529.    SYMBOL (input)  : code number of the symbol to be plotted at each
  1530.                      point (see PGPT).
  1531.    NS     (input)  : number of values in the SYMBOL array.  If NS <= N,
  1532.                      then the first NS points are drawn using the value
  1533.                      of SYMBOL(I) at (X(I), Y(I)) and SYMBOL(1) for all
  1534.                      the values of (X(I), Y(I)) where I > NS.
  1535.   
  1536.   Note: the dimension of arrays X and Y must be greater than or equal
  1537.   to N and the dimension of the array SYMBOL must be greater than or
  1538.   equal to NS.  If N is 1, X and Y may be scalars (constants or
  1539.   variables).  If NS is 1, then SYMBOL may be a scalar.  If N is
  1540.   less than 1, nothing is drawn.
  1541.  
  1542. 2 PGPOLY -- fill a polygonal area with shading
  1543.       SUBROUTINE PGPOLY (N, XPTS, YPTS)
  1544.       INTEGER N
  1545.       REAL XPTS(*), YPTS(*)
  1546.   
  1547.   Fill-area primitive routine: shade the interior of a closed
  1548.   polygon in the current window.  The action of this routine depends
  1549.   on the setting of the Fill-Area Style attribute (see PGSFS).
  1550.   The polygon is clipped at the edge of the
  1551.   window. The pen position is changed to (XPTS(1),YPTS(1)) in world
  1552.   coordinates (if N > 1).  If the polygon is not convex, a point is
  1553.   assumed to lie inside the polygon if a straight line drawn to
  1554.   infinity intersects and odd number of the polygon's edges.
  1555.   
  1556.   Arguments:
  1557.    N      (input)  : number of points defining the polygon; the
  1558.                      line consists of N straight-line segments,
  1559.                      joining points 1 to 2, 2 to 3,... N-1 to N, N to 1.
  1560.                      N should be greater than 2 (if it is 2 or less,
  1561.                      nothing will be drawn).
  1562.    XPTS   (input)  : world x-coordinates of the vertices.
  1563.    YPTS   (input)  : world y-coordinates of the vertices.
  1564.                      Note: the dimension of arrays XPTS and YPTS must be
  1565.                      greater than or equal to N.
  1566.  
  1567. 2 PGPT -- draw one or more graph markers
  1568.       SUBROUTINE PGPT (N, XPTS, YPTS, SYMBOL)
  1569.       INTEGER N
  1570.       REAL XPTS(*), YPTS(*)
  1571.       INTEGER SYMBOL
  1572.   
  1573.   Primitive routine to draw Graph Markers (polymarker). The markers
  1574.   are drawn using the current values of attributes color-index,
  1575.   line-width, and character-height (character-font applies if the symbol
  1576.   number is >31).  If the point to be marked lies outside the window,
  1577.   no marker is drawn.  The "pen position" is changed to
  1578.   (XPTS(N),YPTS(N)) in world coordinates (if N > 0).
  1579.   
  1580.   Arguments:
  1581.    N      (input)  : number of points to mark.
  1582.    XPTS   (input)  : world x-coordinates of the points.
  1583.    YPTS   (input)  : world y-coordinates of the points.
  1584.    SYMBOL (input)  : code number of the symbol to be drawn at each 
  1585.                      point:
  1586.                      -1, -2  : a single dot (diameter = current
  1587.                                line width).
  1588.                      -3..-31 : a regular polygon with ABS(SYMBOL)
  1589.                                edges (style set by current fill style).
  1590.                      0..31   : standard marker symbols.
  1591.                      32..127 : ASCII characters (in current font).
  1592.                                e.g. to use letter F as a marker, let
  1593.                                SYMBOL = ICHAR('F'). 
  1594.                      > 127  :  a Hershey symbol number.
  1595.   
  1596.   Note: the dimension of arrays X and Y must be greater than or equal
  1597.   to N. If N is 1, X and Y may be scalars (constants or variables). If
  1598.   N is less than 1, nothing is drawn.
  1599.  
  1600. 2 PGPTXT -- write text at arbitrary position and angle
  1601.       SUBROUTINE PGPTXT (X, Y, ANGLE, FJUST, TEXT)
  1602.       REAL X, Y, ANGLE, FJUST
  1603.       CHARACTER*(*) TEXT
  1604.   
  1605.   Primitive routine for drawing text. The text may be drawn at any
  1606.   angle with the horizontal, and may be centered or left- or right-
  1607.   justified at a specified position.  Routine PGTEXT provides a
  1608.   simple interface to PGPTXT for horizontal strings. Text is drawn
  1609.   using the current values of attributes color-index, line-width,
  1610.   character-height, and character-font.  Text is NOT subject to
  1611.   clipping at the edge of the window.
  1612.   
  1613.   Arguments:
  1614.    X      (input)  : world x-coordinate.
  1615.    Y      (input)  : world y-coordinate. The string is drawn with the
  1616.                      baseline of all the characters passing through
  1617.                      point (X,Y); the positioning of the string along
  1618.                      this line is controlled by argument FJUST.
  1619.    ANGLE  (input)  : angle, in degrees, that the baseline is to make
  1620.                      with the horizontal, increasing counter-clockwise
  1621.                      (0.0 is horizontal).
  1622.    FJUST  (input)  : controls horizontal justification of the string.
  1623.                      If FJUST = 0.0, the string will be left-justified
  1624.                      at the point (X,Y); if FJUST = 0.5, it will be
  1625.                      centered, and if FJUST = 1.0, it will be right
  1626.                      justified. [Other values of FJUST give other
  1627.                      justifications.]
  1628.    TEXT   (input)  : the character string to be plotted.
  1629.  
  1630. 2 PGQAH -- inquire arrow-head style
  1631.       SUBROUTINE PGQAH (FS, ANGLE, VENT)
  1632.       INTEGER  FS
  1633.       REAL ANGLE, VENT
  1634.   
  1635.   Query the style to be used for arrowheads drawn with routine PGARRO.
  1636.   
  1637.   Argument:
  1638.    FS     (output) : FS = 1 => filled; FS = 2 => outline.
  1639.    ANGLE  (output) : the acute angle of the arrow point, in degrees.
  1640.    VENT   (output) : the fraction of the triangular arrow-head that
  1641.                      is cut away from the back. 
  1642.  
  1643. 2 PGQCF -- inquire character font
  1644.       SUBROUTINE PGQCF (FONT)
  1645.       INTEGER  FONT
  1646.   
  1647.   Query the current Character Font (set by routine PGSCF).
  1648.   
  1649.   Argument:
  1650.    FONT   (output)   : the current font number (in range 1-4).
  1651.  
  1652. 2 PGQCH -- inquire character height
  1653.       SUBROUTINE PGQCH (SIZE)
  1654.       REAL SIZE
  1655.   
  1656.   Query the Character Size attribute (set by routine PGSCH).
  1657.   
  1658.   Argument:
  1659.    SIZE   (output) : current character size (dimensionless multiple of
  1660.                      the default size).
  1661.  
  1662. 2 PGQCI -- inquire color index
  1663.       SUBROUTINE PGQCI (CI)
  1664.       INTEGER  CI
  1665.   
  1666.   Query the Color Index attribute (set by routine PGSCI).
  1667.   
  1668.   Argument:
  1669.    CI     (output) : the current color index (in range 0-max). This is
  1670.                      the color index actually in use, and may differ
  1671.                      from the color index last requested by PGSCI if
  1672.                      that index is not available on the output device.
  1673.  
  1674. 2 PGQCIR -- inquire color index range
  1675.       SUBROUTINE PGQCIR(ICILO, ICIHI)
  1676.       INTEGER   ICILO, ICIHI
  1677.   
  1678.   Query the color index range to be used for producing images with
  1679.   PGGRAY or PGIMAG, as set by routine PGSCIR or by device default.
  1680.   
  1681.   Arguments:
  1682.    ICILO  (output) : the lowest color index to use for images
  1683.    ICIHI  (output) : the highest color index to use for images
  1684.  
  1685. 2 PGQCOL -- inquire color capability
  1686.       SUBROUTINE PGQCOL (CI1, CI2)
  1687.       INTEGER  CI1, CI2
  1688.   
  1689.   Query the range of color indices available on the current device.
  1690.   
  1691.   Argument:
  1692.    CI1    (output) : the minimum available color index. This will be
  1693.                      either 0 if the device can write in the
  1694.                      background color, or 1 if not.
  1695.    CI2    (output) : the maximum available color index. This will be
  1696.                      1 if the device has no color capability, or a
  1697.                      larger number (e.g., 3, 7, 15, 255).
  1698.  
  1699. 2 PGQCR  -- inquire color representation
  1700.       SUBROUTINE PGQCR (CI, CR, CG, CB)
  1701.       INTEGER CI
  1702.       REAL    CR, CG, CB
  1703.   
  1704.   Query the RGB colors associated with a color index.
  1705.   
  1706.   Arguments:
  1707.    CI  (input)  : color index
  1708.    CR  (output) : red, green and blue intensities
  1709.    CG  (output)   in the range 0.0 to 1.0
  1710.    CB  (output)
  1711.  
  1712. 2 PGQCS  -- inquire character height in a variety of units
  1713.       SUBROUTINE PGQCS(UNITS, XCH, YCH)
  1714.       INTEGER UNITS
  1715.       REAL XCH, YCH
  1716.   
  1717.   Return the current PGPLOT character height in a variety of units.
  1718.   This routine provides facilities that are not available via PGQCH.
  1719.   Use PGQCS if the character height is required in units other than
  1720.   those used in PGSCH.
  1721.   
  1722.   The PGPLOT "character height" is a dimension that scales with the
  1723.   size of the view surface and with the scale-factor specified with
  1724.   routine PGSCH. The default value is 1/40th of the height or width
  1725.   of the view surface (whichever is less); this value is then
  1726.   multiplied by the scale-factor supplied with PGSCH. Note that it
  1727.   is a nominal height only; the actual character size depends on the
  1728.   font and is usually somewhat smaller.
  1729.   
  1730.   Arguments:
  1731.    UNITS  (input)  : Used to specify the units of the output value:
  1732.                      UNITS = 0 : normalized device coordinates
  1733.                      UNITS = 1 : inches
  1734.                      UNITS = 2 : millimeters
  1735.                      UNITS = 3 : pixels
  1736.                      UNITS = 4 : world coordinates
  1737.                      Other values give an error message, and are
  1738.                      treated as 0.
  1739.    XCH    (output) : The character height for text written with a
  1740.                      vertical baseline.
  1741.    YCH    (output) : The character height for text written with
  1742.                      a horizontal baseline (the usual case).
  1743.   
  1744.   The character height is returned in both XCH and YCH.
  1745.   
  1746.   If UNITS=1 or UNITS=2, XCH and YCH both receive the same value.
  1747.   
  1748.   If UNITS=3, XCH receives the height in horizontal pixel units, and YCH
  1749.   receives the height in vertical pixel units; on devices for which the
  1750.   pixels are not square, XCH and YCH will be different.
  1751.   
  1752.   If UNITS=4, XCH receives the height in horizontal world coordinates
  1753.   (as used for the x-axis), and YCH receives the height in vertical
  1754.   world coordinates (as used for the y-axis). Unless special care has
  1755.   been taken to achive equal world-coordinate scales on both axes, the
  1756.   values of XCH and YCH will be different.
  1757.   
  1758.   If UNITS=0, XCH receives the character height as a fraction of the
  1759.   horizontal dimension of the view surface, and YCH receives the
  1760.   character height as a fraction of the vertical dimension of the view
  1761.   surface.
  1762.  
  1763. 2 PGQFS -- inquire fill-area style
  1764.       SUBROUTINE PGQFS (FS)
  1765.       INTEGER  FS
  1766.   
  1767.   Query the current Fill-Area Style attribute (set by routine
  1768.   PGSFS).
  1769.   
  1770.   Argument:
  1771.    FS     (output) : the current fill-area style:
  1772.                        FS = 1 => solid (default)
  1773.                        FS = 2 => outline
  1774.                        FS = 3 => hatched
  1775.                        FS = 4 => cross-hatched
  1776.  
  1777. 2 PGQHS -- inquire hatching style
  1778.       SUBROUTINE PGQHS (ANGLE, SEPN, PHASE)
  1779.       REAL ANGLE, SEPN, PHASE
  1780.   
  1781.   Query the style to be used hatching (fill area with fill-style 3).
  1782.   
  1783.   Arguments:
  1784.    ANGLE  (output) : the angle the hatch lines make with the
  1785.                      horizontal, in degrees, increasing 
  1786.                      counterclockwise (this is an angle on the
  1787.                      view surface, not in world-coordinate space).
  1788.    SEPN   (output) : the spacing of the hatch lines. The unit spacing
  1789.                      is 1 percent of the smaller of the height or
  1790.                      width of the view surface.
  1791.    PHASE  (output) : a real number between 0 and 1; the hatch lines
  1792.                      are displaced by this fraction of SEPN from a
  1793.                      fixed reference.  Adjacent regions hatched with the
  1794.                      same PHASE have contiguous hatch lines.
  1795.  
  1796. 2 PGQID -- inquire current device identifier
  1797.       SUBROUTINE PGQID (ID)
  1798.       INTEGER  ID
  1799.   
  1800.   This subroutine returns the identifier of the currently
  1801.   selected device, or 0 if no device is selected.  The identifier is
  1802.   assigned when PGOPEN is called to open the device, and may be used
  1803.   as an argument to PGSLCT.  Each open device has a different
  1804.   identifier.
  1805.   
  1806.   [This routine was added to PGPLOT in Version 5.1.0.]
  1807.   
  1808.   Argument:
  1809.    ID     (output) : the identifier of the current device, or 0 if
  1810.                      no device is currently selected.
  1811.  
  1812. 2 PGQINF -- inquire PGPLOT general information
  1813.       SUBROUTINE PGQINF (ITEM, VALUE, LENGTH)
  1814.       CHARACTER*(*) ITEM, VALUE
  1815.       INTEGER LENGTH
  1816.   
  1817.   This routine can be used to obtain miscellaneous information about
  1818.   the PGPLOT environment. Input is a character string defining the
  1819.   information required, and output is a character string containing the
  1820.   requested information.
  1821.   
  1822.   The following item codes are accepted (note that the strings must
  1823.   match exactly, except for case, but only the first 8 characters are
  1824.   significant). For items marked *, PGPLOT must be in the OPEN state
  1825.   for the inquiry to succeed. If the inquiry is unsuccessful, either
  1826.   because the item code is not recognized or because the information
  1827.   is not available, a question mark ('?') is returned.
  1828.   
  1829.     'VERSION'     - version of PGPLOT software in use.
  1830.     'STATE'       - status of PGPLOT ('OPEN' if a graphics device
  1831.                     is open for output, 'CLOSED' otherwise).
  1832.     'USER'        - the username associated with the calling program.
  1833.     'NOW'         - current date and time (e.g., '17-FEB-1986 10:04').
  1834.     'DEVICE'    * - current PGPLOT device or file.
  1835.     'FILE'      * - current PGPLOT device or file.
  1836.     'TYPE'      * - device-type of the current PGPLOT device.
  1837.     'DEV/TYPE'  * - current PGPLOT device and type, in a form which
  1838.                     is acceptable as an argument for PGBEG.
  1839.     'HARDCOPY'  * - is the current device a hardcopy device? ('YES' or
  1840.                     'NO').
  1841.     'TERMINAL'  * - is the current device the user's interactive
  1842.                     terminal? ('YES' or 'NO').
  1843.     'CURSOR'    * - does the current device have a graphics cursor?
  1844.                     ('YES' or 'NO').
  1845.   
  1846.   Arguments:
  1847.    ITEM  (input)  : character string defining the information to
  1848.                     be returned; see above for a list of possible
  1849.                     values.
  1850.    VALUE (output) : returns a character-string containing the
  1851.                     requested information, truncated to the length 
  1852.                     of the supplied string or padded on the right with 
  1853.                     spaces if necessary.
  1854.    LENGTH (output): the number of characters returned in VALUE
  1855.                     (excluding trailing blanks).
  1856.  
  1857. 2 PGQITF -- inquire image transfer function
  1858.       SUBROUTINE PGQITF (ITF)
  1859.       INTEGER  ITF
  1860.   
  1861.   Return the Image Transfer Function as set by default or by a previous
  1862.   call to PGSITF. The Image Transfer Function is used by routines
  1863.   PGIMAG, PGGRAY, and PGWEDG.
  1864.   
  1865.   Argument:
  1866.    ITF    (output) : type of transfer function (see PGSITF)
  1867.  
  1868. 2 PGQLS -- inquire line style
  1869.       SUBROUTINE PGQLS (LS)
  1870.       INTEGER  LS
  1871.   
  1872.   Query the current Line Style attribute (set by routine PGSLS).
  1873.   
  1874.   Argument:
  1875.    LS     (output) : the current line-style attribute (in range 1-5).
  1876.  
  1877. 2 PGQLW -- inquire line width
  1878.       SUBROUTINE PGQLW (LW)
  1879.       INTEGER  LW
  1880.   
  1881.   Query the current Line-Width attribute (set by routine PGSLW).
  1882.   
  1883.   Argument:
  1884.    LW     (output)  : the line-width (in range 1-201).
  1885.  
  1886. 2 PGQPOS -- inquire current pen position
  1887.       SUBROUTINE PGQPOS (X, Y)
  1888.       REAL X, Y
  1889.   
  1890.   Query the current "pen" position in world C coordinates (X,Y).
  1891.   
  1892.   Arguments:
  1893.    X      (output)  : world x-coordinate of the pen position.
  1894.    Y      (output)  : world y-coordinate of the pen position.
  1895.  
  1896. 2 PGQTBG -- inquire text background color index
  1897.       SUBROUTINE PGQTBG (TBCI)
  1898.       INTEGER  TBCI
  1899.   
  1900.   Query the current Text Background Color Index (set by routine
  1901.   PGSTBG).
  1902.   
  1903.   Argument:
  1904.    TBCI   (output) : receives the current text background color index.
  1905.  
  1906. 2 PGQTXT -- find bounding box of text string
  1907.       SUBROUTINE PGQTXT (X, Y, ANGLE, FJUST, TEXT, XBOX, YBOX)
  1908.       REAL X, Y, ANGLE, FJUST
  1909.       CHARACTER*(*) TEXT
  1910.       REAL XBOX(4), YBOX(4)
  1911.   
  1912.   This routine returns a bounding box for a text string. Instead
  1913.   of drawing the string as routine PGPTXT does, it returns in XBOX
  1914.   and YBOX the coordinates of the corners of a rectangle parallel
  1915.   to the string baseline that just encloses the string.
  1916.   
  1917.   If the string is blank or contains no drwable characters, all
  1918.   four elements of XBOX and YBOX are assigned the starting point
  1919.   of the string, (X,Y).
  1920.   
  1921.   Arguments:
  1922.    X, Y, ANGLE, FJUST, TEXT (input) : these arguments are the same as
  1923.                      the corrresponding arguments in PGPTXT.
  1924.    XBOX, YBOX (output) : arrays of dimension 4; on output, they
  1925.                      contain the world coordinates of the bounding
  1926.                      box in (XBOX(1), YBOX(1)), ..., (XBOX(4), YBOX(4)).
  1927.  
  1928. 2 PGQVP -- inquire viewport size and position
  1929.       SUBROUTINE PGQVP (UNITS, X1, X2, Y1, Y2)
  1930.       INTEGER UNITS
  1931.       REAL    X1, X2, Y1, Y2
  1932.   
  1933.   Inquiry routine to determine the current viewport setting.
  1934.   The values returned may be normalized device coordinates, inches, mm,
  1935.   or pixels, depending on the value of the input parameter CFLAG.
  1936.   
  1937.   Arguments:
  1938.    UNITS  (input)  : used to specify the units of the output parameters:
  1939.                      UNITS = 0 : normalized device coordinates
  1940.                      UNITS = 1 : inches
  1941.                      UNITS = 2 : millimeters
  1942.                      UNITS = 3 : pixels
  1943.                      Other values give an error message, and are
  1944.                      treated as 0.
  1945.    X1     (output) : the x-coordinate of the bottom left corner of the
  1946.                      viewport.
  1947.    X2     (output) : the x-coordinate of the top right corner of the
  1948.                      viewport.
  1949.    Y1     (output) : the y-coordinate of the bottom left corner of the
  1950.                      viewport.
  1951.    Y2     (output) : the y-coordinate of the top right corner of the
  1952.                      viewport.
  1953.  
  1954. 2 PGQVSZ -- find the window defined by the full view surface
  1955.       SUBROUTINE PGQVSZ (UNITS, X1, X2, Y1, Y2)
  1956.       INTEGER UNITS
  1957.       REAL X1, X2, Y1, Y2
  1958.   
  1959.   Return the window, in a variety of units, defined by the full
  1960.   device view surface (0 -> 1 in normalized device coordinates).
  1961.   
  1962.   Input:
  1963.     UNITS    0,1,2,3 for output in normalized device coords, 
  1964.              inches, mm, or absolute device units (dots)
  1965.   Output
  1966.     X1,X2    X window
  1967.     Y1,Y2    Y window
  1968.   
  1969.  
  1970. 2 PGQWIN -- inquire window boundary coordinates
  1971.       SUBROUTINE PGQWIN (X1, X2, Y1, Y2)
  1972.       REAL X1, X2, Y1, Y2
  1973.   
  1974.   Inquiry routine to determine the current window setting.
  1975.   The values returned are world coordinates.
  1976.   
  1977.   Arguments:
  1978.    X1     (output) : the x-coordinate of the bottom left corner
  1979.                      of the window.
  1980.    X2     (output) : the x-coordinate of the top right corner
  1981.                      of the window.
  1982.    Y1     (output) : the y-coordinate of the bottom left corner
  1983.                      of the window.
  1984.    Y2     (output) : the y-coordinate of the top right corner
  1985.                      of the window.
  1986.  
  1987. 2 PGRECT -- draw a rectangle, using fill-area attributes
  1988.       SUBROUTINE PGRECT (X1, X2, Y1, Y2)
  1989.       REAL X1, X2, Y1, Y2
  1990.   
  1991.   This routine can be used instead of PGPOLY for the special case of
  1992.   drawing a rectangle aligned with the coordinate axes; only two
  1993.   vertices need be specified instead of four.  On most devices, it is
  1994.   faster to use PGRECT than PGPOLY for drawing rectangles.  The
  1995.   rectangle has vertices at (X1,Y1), (X1,Y2), (X2,Y2), and (X2,Y1).
  1996.   
  1997.   Arguments:
  1998.    X1, X2 (input) : the horizontal range of the rectangle.
  1999.    Y1, Y2 (input) : the vertical range of the rectangle.
  2000.  
  2001. 2 PGRND -- find the smallest `round' number greater than x
  2002.       REAL FUNCTION PGRND (X, NSUB)
  2003.       REAL X
  2004.       INTEGER NSUB
  2005.   
  2006.   Routine to find the smallest "round" number larger than x, a
  2007.   "round" number being 1, 2 or 5 times a power of 10. If X is negative,
  2008.   PGRND(X) = -PGRND(ABS(X)). eg PGRND(8.7) = 10.0,
  2009.   PGRND(-0.4) = -0.5.  If X is zero, the value returned is zero.
  2010.   This routine is used by PGBOX for choosing  tick intervals.
  2011.   
  2012.   Returns:
  2013.    PGRND         : the "round" number.
  2014.   Arguments:
  2015.    X      (input)  : the number to be rounded.
  2016.    NSUB   (output) : a suitable number of subdivisions for
  2017.                      subdividing the "nice" number: 2 or 5.
  2018.  
  2019. 2 PGRNGE -- choose axis limits
  2020.       SUBROUTINE PGRNGE (X1, X2, XLO, XHI)
  2021.       REAL X1, X2, XLO, XHI
  2022.   
  2023.   Choose plotting limits XLO and XHI which encompass the data
  2024.   range X1 to X2.
  2025.   
  2026.   Arguments:
  2027.    X1, X2 (input)  : the data range (X1<X2), ie, the min and max values
  2028.                      to be plotted.
  2029.    XLO, XHI (output) : suitable values to use as the extremes of a graph
  2030.                      axis (XLO <= X1, XHI >= X2).
  2031.  
  2032. 2 PGSAH -- set arrow-head style
  2033.       SUBROUTINE PGSAH (FS, ANGLE, VENT)
  2034.       INTEGER  FS
  2035.       REAL ANGLE, VENT
  2036.   
  2037.   Set the style to be used for arrowheads drawn with routine PGARRO.
  2038.   
  2039.   Argument:
  2040.    FS     (input)  : FS = 1 => filled; FS = 2 => outline.
  2041.                      Other values are treated as 2. Default 1.
  2042.    ANGLE  (input)  : the acute angle of the arrow point, in degrees;
  2043.                      angles in the range 20.0 to 90.0 give reasonable
  2044.                      results. Default 45.0.
  2045.    VENT   (input)  : the fraction of the triangular arrow-head that
  2046.                      is cut away from the back. 0.0 gives a triangular
  2047.                      wedge arrow-head; 1.0 gives an open >. Values 0.3
  2048.                      to 0.7 give reasonable results. Default 0.3.
  2049.  
  2050. 2 PGSAVE -- save PGPLOT attributes
  2051.       SUBROUTINE PGSAVE
  2052.   
  2053.   This routine saves the current PGPLOT attributes in a private storage
  2054.   area. They can be restored by calling PGUNSA (unsave). Attributes
  2055.   saved are: character font, character height, color index, fill-area
  2056.   style, line style, line width, pen position, arrow-head style, 
  2057.   hatching style. Color representation is not saved.
  2058.   
  2059.   Calls to PGSAVE and PGUNSA should always be paired. Up to 20 copies
  2060.   of the attributes may be saved. PGUNSA always retrieves the last-saved
  2061.   values (first-in first-out stack).
  2062.   
  2063.   Arguments: none
  2064.  
  2065. 2 PGUNSA -- restore PGPLOT attributes
  2066.       ENTRY PGUNSA
  2067.   
  2068.   This routine restores the PGPLOT attributes saved in the last call to
  2069.   PGSAVE. See PGSAVE.
  2070.   
  2071.   Arguments: none
  2072.  
  2073. 2 PGSCF -- set character font
  2074.       SUBROUTINE PGSCF (FONT)
  2075.       INTEGER  FONT
  2076.   
  2077.   Set the Character Font for subsequent text plotting. Four different
  2078.   fonts are available:
  2079.     1: (default) a simple single-stroke font ("normal" font)
  2080.     2: roman font
  2081.     3: italic font
  2082.     4: script font
  2083.   This call determines which font is in effect at the beginning of
  2084.   each text string. The font can be changed (temporarily) within a text
  2085.   string by using the escape sequences \fn, \fr, \fi, and \fs for fonts
  2086.   1, 2, 3, and 4, respectively.
  2087.   
  2088.   Argument:
  2089.    FONT   (input)  : the font number to be used for subsequent text
  2090.                      plotting (in range 1-4).
  2091.  
  2092. 2 PGSCH -- set character height
  2093.       SUBROUTINE PGSCH (SIZE)
  2094.       REAL SIZE
  2095.   
  2096.   Set the character size attribute. The size affects all text and graph
  2097.   markers drawn later in the program. The default character size is
  2098.   1.0, corresponding to a character height about 1/40 the height of
  2099.   the view surface.  Changing the character size also scales the length
  2100.   of tick marks drawn by PGBOX and terminals drawn by PGERRX and PGERRY.
  2101.   
  2102.   Argument:
  2103.    SIZE   (input)  : new character size (dimensionless multiple of
  2104.                      the default size).
  2105.  
  2106. 2 PGSCI -- set color index
  2107.       SUBROUTINE PGSCI (CI)
  2108.       INTEGER  CI
  2109.   
  2110.   Set the Color Index for subsequent plotting, if the output device
  2111.   permits this. The default color index is 1, usually white on a black
  2112.   background for video displays or black on a white background for
  2113.   printer plots. The color index is an integer in the range 0 to a
  2114.   device-dependent maximum. Color index 0 corresponds to the background
  2115.   color; lines may be "erased" by overwriting them with color index 0
  2116.   (if the device permits this).
  2117.   
  2118.   If the requested color index is not available on the selected device,
  2119.   color index 1 will be substituted.
  2120.   
  2121.   The assignment of colors to color indices can be changed with
  2122.   subroutine PGSCR (set color representation).  Color indices 0-15
  2123.   have predefined color representations (see the PGPLOT manual), but
  2124.   these may be changed with PGSCR.  Color indices above 15  have no
  2125.   predefined representations: if these indices are used, PGSCR must
  2126.   be called to define the representation.
  2127.   
  2128.   Argument:
  2129.    CI     (input)  : the color index to be used for subsequent plotting
  2130.                      on the current device (in range 0-max). If the
  2131.                      index exceeds the device-dependent maximum, the
  2132.                      default color index (1) is used.
  2133.  
  2134. 2 PGSCIR -- set color index range
  2135.       SUBROUTINE PGSCIR(ICILO, ICIHI)
  2136.       INTEGER   ICILO, ICIHI
  2137.   
  2138.   Set the color index range to be used for producing images with
  2139.   PGGRAY or PGIMAG. If the range is not all within the range supported
  2140.   by the device, a smaller range will be used. The number of
  2141.   different colors available for images is ICIHI-ICILO+1.
  2142.   
  2143.   Arguments:
  2144.    ICILO  (input)  : the lowest color index to use for images
  2145.    ICIHI  (input)  : the highest color index to use for images
  2146.  
  2147. 2 PGSCR -- set color representation
  2148.       SUBROUTINE PGSCR (CI, CR, CG, CB)
  2149.       INTEGER CI
  2150.       REAL    CR, CG, CB
  2151.   
  2152.   Set color representation: i.e., define the color to be
  2153.   associated with a color index.  Ignored for devices which do not
  2154.   support variable color or intensity.  Color indices 0-15
  2155.   have predefined color representations (see the PGPLOT manual), but
  2156.   these may be changed with PGSCR.  Color indices 16-maximum have no
  2157.   predefined representations: if these indices are used, PGSCR must
  2158.   be called to define the representation. On monochrome output
  2159.   devices (e.g. VT125 terminals with monochrome monitors), the
  2160.   monochrome intensity is computed from the specified Red, Green, Blue
  2161.   intensities as 0.30*R + 0.59*G + 0.11*B, as in US color television
  2162.   systems, NTSC encoding.  Note that most devices do not have an
  2163.   infinite range of colors or monochrome intensities available;
  2164.   the nearest available color is used.  Examples: for black,
  2165.   set CR=CG=CB=0.0; for white, set CR=CG=CB=1.0; for medium gray,
  2166.   set CR=CG=CB=0.5; for medium yellow, set CR=CG=0.5, CB=0.0.
  2167.   
  2168.   Argument:
  2169.    CI     (input)  : the color index to be defined, in the range 0-max.
  2170.                      If the color index greater than the device
  2171.                      maximum is specified, the call is ignored. Color
  2172.                      index 0 applies to the background color.
  2173.    CR     (input)  : red, green, and blue intensities,
  2174.    CG     (input)    in range 0.0 to 1.0.
  2175.    CB     (input)
  2176.  
  2177. 2 PGSCRN -- set color representation by name
  2178.       SUBROUTINE PGSCRN(CI, NAME, IER)
  2179.       INTEGER CI
  2180.       CHARACTER*(*) NAME
  2181.       INTEGER IER
  2182.   
  2183.   Set color representation: i.e., define the color to be
  2184.   associated with a color index.  Ignored for devices which do not
  2185.   support variable color or intensity.  This is an alternative to
  2186.   routine PGSCR. The color representation is defined by name instead
  2187.   of (R,G,B) components.
  2188.   
  2189.   Color names are defined in an external file which is read the first
  2190.   time that PGSCRN is called. The name of the external file is
  2191.   found as follows:
  2192.   1. if environment variable (logical name) PGPLOT_RGB is defined,
  2193.      its value is used as the file name;
  2194.   2. otherwise, if environment variable PGPLOT_DIR is defined, a
  2195.      file "rgb.txt" in the directory named by this environment
  2196.      variable is used;
  2197.   3. otherwise, file "rgb.txt" in the current directory is used.
  2198.   If all of these fail to find a file, an error is reported and
  2199.   the routine does nothing.
  2200.   
  2201.   Each line of the file
  2202.   defines one color, with four blank- or tab-separated fields per
  2203.   line. The first three fields are the R, G, B components, which
  2204.   are integers in the range 0 (zero intensity) to 255 (maximum
  2205.   intensity). The fourth field is the color name. The color name
  2206.   may include embedded blanks. Example:
  2207.   
  2208.   255   0   0 red
  2209.   255 105 180 hot pink
  2210.   255 255 255 white
  2211.     0   0   0 black
  2212.   
  2213.   Arguments:
  2214.    CI     (input)  : the color index to be defined, in the range 0-max.
  2215.                      If the color index greater than the device
  2216.                      maximum is specified, the call is ignored. Color
  2217.                      index 0 applies to the background color.
  2218.    NAME   (input)  : the name of the color to be associated with
  2219.                      this color index. This name must be in the
  2220.                      external file. The names are not case-sensitive.
  2221.                      If the color is not listed in the file, the
  2222.                      color representation is not changed.
  2223.    IER    (output) : returns 0 if the routine was successful, 1
  2224.                      if an error occurred (either the external file
  2225.                      could not be read, or the requested color was
  2226.                      not defined in the file).
  2227.  
  2228. 2 PGSFS -- set fill-area style
  2229.       SUBROUTINE PGSFS (FS)
  2230.       INTEGER  FS
  2231.   
  2232.   Set the Fill-Area Style attribute for subsequent area-fill by
  2233.   PGPOLY, PGRECT, or PGCIRC.  Four different styles are available: 
  2234.   solid (fill polygon with solid color of the current color-index), 
  2235.   outline (draw outline of polygon only, using current line attributes),
  2236.   hatched (shade interior of polygon with parallel lines, using
  2237.   current line attributes), or cross-hatched. The orientation and
  2238.   spacing of hatch lines can be specified with routine PGSHS (set
  2239.   hatch style).
  2240.   
  2241.   Argument:
  2242.    FS     (input)  : the fill-area style to be used for subsequent
  2243.                      plotting:
  2244.                        FS = 1 => solid (default)
  2245.                        FS = 2 => outline
  2246.                        FS = 3 => hatched
  2247.                        FS = 4 => cross-hatched
  2248.                      Other values give an error message and are
  2249.                      treated as 2.
  2250.  
  2251. 2 PGSHLS -- set color representation using HLS system
  2252.       SUBROUTINE PGSHLS (CI, CH, CL, CS)
  2253.       INTEGER CI
  2254.       REAL    CH, CL, CS
  2255.   
  2256.   Set color representation: i.e., define the color to be
  2257.   associated with a color index.  This routine is equivalent to
  2258.   PGSCR, but the color is defined in the Hue-Lightness-Saturation
  2259.   model instead of the Red-Green-Blue model. Hue is represented
  2260.   by an angle in degrees, with red at 120, green at 240,
  2261.   and blue at 0 (or 360). Lightness ranges from 0.0 to 1.0, with black
  2262.   at lightness 0.0 and white at lightness 1.0. Saturation ranges from
  2263.   0.0 (gray) to 1.0 (pure color). Hue is irrelevant when saturation
  2264.   is 0.0.
  2265.   
  2266.   Examples:           H     L     S        R     G     B
  2267.       black          any   0.0   0.0      0.0   0.0   0.0
  2268.       white          any   1.0   0.0      1.0   1.0   1.0
  2269.       medium gray    any   0.5   0.0      0.5   0.5   0.5
  2270.       red            120   0.5   1.0      1.0   0.0   0.0
  2271.       yellow         180   0.5   1.0      1.0   1.0   0.0
  2272.       pink           120   0.7   0.8      0.94  0.46  0.46
  2273.   
  2274.   Reference: SIGGRAPH Status Report of the Graphic Standards Planning
  2275.   Committee, Computer Graphics, Vol.13, No.3, Association for
  2276.   Computing Machinery, New York, NY, 1979. See also: J. D. Foley et al,
  2277.   ``Computer Graphics: Principles and Practice'', second edition,
  2278.   Addison-Wesley, 1990, section 13.3.5.
  2279.   
  2280.   Argument:
  2281.    CI     (input)  : the color index to be defined, in the range 0-max.
  2282.                      If the color index greater than the device
  2283.                      maximum is specified, the call is ignored. Color
  2284.                      index 0 applies to the background color.
  2285.    CH     (input)  : hue, in range 0.0 to 360.0.
  2286.    CL     (input)  : lightness, in range 0.0 to 1.0.
  2287.    CS     (input)  : saturation, in range 0.0 to 1.0.
  2288.  
  2289. 2 PGSHS -- set hatching style
  2290.       SUBROUTINE PGSHS (ANGLE, SEPN, PHASE)
  2291.       REAL ANGLE, SEPN, PHASE
  2292.   
  2293.   Set the style to be used for hatching (fill area with fill-style 3).
  2294.   The default style is ANGLE=45.0, SEPN=1.0, PHASE=0.0.
  2295.   
  2296.   Arguments:
  2297.    ANGLE  (input)  : the angle the hatch lines make with the
  2298.                      horizontal, in degrees, increasing 
  2299.                      counterclockwise (this is an angle on the
  2300.                      view surface, not in world-coordinate space).
  2301.    SEPN   (input)  : the spacing of the hatch lines. The unit spacing
  2302.                      is 1 percent of the smaller of the height or
  2303.                      width of the view surface. This should not be
  2304.                      zero.
  2305.    PHASE  (input)  : a real number between 0 and 1; the hatch lines
  2306.                      are displaced by this fraction of SEPN from a
  2307.                      fixed reference.  Adjacent regions hatched with the
  2308.                      same PHASE have contiguous hatch lines. To hatch
  2309.                      a region with alternating lines of two colors,
  2310.                      fill the area twice, with PHASE=0.0 for one color
  2311.                      and PHASE=0.5 for the other color.
  2312.  
  2313. 2 PGSITF -- set image transfer function
  2314.       SUBROUTINE PGSITF (ITF)
  2315.       INTEGER  ITF
  2316.   
  2317.   Set the Image Transfer Function for subsequent images drawn by
  2318.   PGIMAG, PGGRAY, or PGWEDG. The Image Transfer Function is used
  2319.   to map array values into the available range of color indices
  2320.   specified with routine PGSCIR or (for PGGRAY on some devices)
  2321.   into dot density.
  2322.   
  2323.   Argument:
  2324.    ITF    (input)  : type of transfer function:
  2325.                        ITF = 0 : linear
  2326.                        ITF = 1 : logarithmic
  2327.                        ITF = 2 : square-root
  2328.  
  2329. 2 PGSLCT -- select an open graphics device
  2330.       SUBROUTINE PGSLCT(ID)
  2331.       INTEGER ID
  2332.   
  2333.   Select one of the open graphics devices and direct subsequent
  2334.   plotting to it. The argument is the device identifier returned by
  2335.   PGOPEN when the device was opened. If the supplied argument is not a
  2336.   valid identifier of on open graphics device, a warning message is
  2337.   issued and the current selection is unchanged.
  2338.   
  2339.   [This routine was added to PGPLOT in Version 5.1.0.]
  2340.   
  2341.   Arguments:
  2342.   
  2343.   ID (input, integer): identifier of the device to be selected.
  2344.  
  2345. 2 PGSLS -- set line style
  2346.       SUBROUTINE PGSLS (LS)
  2347.       INTEGER  LS
  2348.   
  2349.   Set the line style attribute for subsequent plotting. This
  2350.   attribute affects line primitives only; it does not affect graph
  2351.   markers, text, or area fill.
  2352.   Five different line styles are available, with the following codes:
  2353.   1 (full line), 2 (dashed), 3 (dot-dash-dot-dash), 4 (dotted),
  2354.   5 (dash-dot-dot-dot). The default is 1 (normal full line).
  2355.   
  2356.   Argument:
  2357.    LS     (input)  : the line-style code for subsequent plotting
  2358.                      (in range 1-5).
  2359.  
  2360. 2 PGSLW -- set line width
  2361.       SUBROUTINE PGSLW (LW)
  2362.       INTEGER  LW
  2363.   
  2364.   Set the line-width attribute. This attribute affects lines, graph
  2365.   markers, and text. The line width is specified in units of 1/200 
  2366.   (0.005) inch (about 0.13 mm) and must be an integer in the range
  2367.   1-201. On some devices, thick lines are generated by tracing each
  2368.   line with multiple strokes offset in the direction perpendicular to
  2369.   the line.
  2370.   
  2371.   Argument:
  2372.    LW     (input)  : width of line, in units of 0.005 inch (0.13 mm)
  2373.                      in range 1-201.
  2374.  
  2375. 2 PGSTBG -- set text background color index
  2376.       SUBROUTINE PGSTBG (TBCI)
  2377.       INTEGER  TBCI
  2378.   
  2379.   Set the Text Background Color Index for subsequent text. By default
  2380.   text does not obscure underlying graphics. If the text background
  2381.   color index is positive, however, text is opaque: the bounding box
  2382.   of the text is filled with the color specified by PGSTBG before
  2383.   drawing the text characters in the current color index set by PGSCI.
  2384.   Use color index 0 to erase underlying graphics before drawing text.
  2385.   
  2386.   Argument:
  2387.    TBCI   (input)  : the color index to be used for the background
  2388.                      for subsequent text plotting:
  2389.                        TBCI < 0  => transparent (default)
  2390.                        TBCI >= 0 => text will be drawn on an opaque
  2391.                      background with color index TBCI.
  2392.  
  2393. 2 PGSUBP -- subdivide view surface into panels
  2394.       SUBROUTINE PGSUBP (NXSUB, NYSUB)
  2395.       INTEGER NXSUB, NYSUB
  2396.   
  2397.   PGPLOT divides the physical surface of the plotting device (screen,
  2398.   window, or sheet of paper) into NXSUB x NYSUB `panels'. When the 
  2399.   view surface is sub-divided in this way, PGPAGE moves to the next
  2400.   panel, not the next physical page. The initial subdivision of the
  2401.   view surface is set in the call to PGBEG. When PGSUBP is called,
  2402.   it forces the next call to PGPAGE to start a new physical page,
  2403.   subdivided in the manner indicated. No plotting should be done
  2404.   between a call of PGSUBP and a call of PGPAGE (or PGENV, which calls
  2405.   PGPAGE).
  2406.   
  2407.   If NXSUB > 0, PGPLOT uses the panels in row order; if <0, 
  2408.   PGPLOT uses them in column order, e.g.,
  2409.        
  2410.    NXSUB=3, NYSUB=2            NXSUB=-3, NYSUB=2   
  2411.                                                  
  2412.   +-----+-----+-----+         +-----+-----+-----+
  2413.   |  1  |  2  |  3  |         |  1  |  3  |  5  |
  2414.   +-----+-----+-----+         +-----+-----+-----+
  2415.   |  4  |  5  |  6  |         |  2  |  4  |  6  |
  2416.   +-----+-----+-----+         +-----+-----+-----+
  2417.   
  2418.   PGPLOT advances from one panels to the next when PGPAGE is called,
  2419.   clearing the screen or starting a new page when the last panel has
  2420.   been used. It is also possible to jump from one panel to another
  2421.   in random order by calling PGPANL.
  2422.   
  2423.   Arguments:
  2424.    NXSUB  (input)  : the number of subdivisions of the view surface in
  2425.                      X (>0 or <0).
  2426.    NYSUB  (input)  : the number of subdivisions of the view surface in
  2427.                      Y (>0).
  2428.  
  2429. 2 PGSVP -- set viewport (normalized device coordinates)
  2430.       SUBROUTINE PGSVP (XLEFT, XRIGHT, YBOT, YTOP)
  2431.       REAL XLEFT, XRIGHT, YBOT, YTOP
  2432.   
  2433.   Change the size and position of the viewport, specifying
  2434.   the viewport in normalized device coordinates.  Normalized
  2435.   device coordinates run from 0 to 1 in each dimension. The
  2436.   viewport is the rectangle on the view surface "through"
  2437.   which one views the graph.  All the PG routines which plot lines
  2438.   etc. plot them within the viewport, and lines are truncated at
  2439.   the edge of the viewport (except for axes, labels etc drawn with
  2440.   PGBOX or PGLAB).  The region of world space (the coordinate
  2441.   space of the graph) which is visible through the viewport is
  2442.   specified by a call to PGSWIN.  It is legal to request a
  2443.   viewport larger than the view surface; only the part which
  2444.   appears on the view surface will be plotted.
  2445.   
  2446.   Arguments:
  2447.    XLEFT  (input)  : x-coordinate of left hand edge of viewport, in NDC.
  2448.    XRIGHT (input)  : x-coordinate of right hand edge of viewport,
  2449.                      in NDC.
  2450.    YBOT   (input)  : y-coordinate of bottom edge of viewport, in NDC.
  2451.    YTOP   (input)  : y-coordinate of top  edge of viewport, in NDC.
  2452.  
  2453. 2 PGSWIN -- set window
  2454.       SUBROUTINE PGSWIN (X1, X2, Y1, Y2)
  2455.       REAL X1, X2, Y1, Y2
  2456.   
  2457.   Change the window in world coordinate space that is to be mapped on
  2458.   to the viewport.  Usually PGSWIN is called automatically by PGENV,
  2459.   but it may be called directly by the user.
  2460.   
  2461.   Arguments:
  2462.    X1     (input)  : the x-coordinate of the bottom left corner
  2463.                      of the viewport.
  2464.    X2     (input)  : the x-coordinate of the top right corner
  2465.                      of the viewport (note X2 may be less than X1).
  2466.    Y1     (input)  : the y-coordinate of the bottom left corner
  2467.                      of the viewport.
  2468.    Y2     (input)  : the y-coordinate of the top right corner
  2469.                      of the viewport (note Y2 may be less than Y1).
  2470.  
  2471. 2 PGTBOX -- draw frame and write (DD) HH MM SS.S labelling
  2472.       SUBROUTINE PGTBOX (XOPT, XTICK, NXSUB, YOPT, YTICK, NYSUB)
  2473.   
  2474.       REAL XTICK, YTICK
  2475.       INTEGER NXSUB, NYSUB
  2476.       CHARACTER XOPT*(*), YOPT*(*)
  2477.   
  2478.   Draw a box and optionally label one or both axes with (DD) HH MM SS 
  2479.   style numeric labels (useful for time or RA - DEC plots).   If this 
  2480.   style of labelling is desired, then PGSWIN should have been called
  2481.   previously with the extrema in SECONDS of time.
  2482.   
  2483.   In the seconds field, you can have at most 3 places after the decimal
  2484.   point, so that 1 ms is the smallest time interval you can time label.
  2485.   
  2486.   Large numbers are coped with by fields of 6 characters long.  Thus 
  2487.   you could have times with days or hours as big as 999999.  However, 
  2488.   in practice, you might have trouble with labels overwriting  themselves
  2489.   with such large numbers unless you a) use a small time INTERVAL, 
  2490.   b) use a small character size or c) choose your own sparse ticks in 
  2491.   the call to PGTBOX.  
  2492.   
  2493.   PGTBOX will attempt, when choosing its own ticks, not to overwrite
  2494.   the labels, but this algorithm is not very bright and may fail.
  2495.   
  2496.   Note that small intervals but large absolute times such as
  2497.   TMIN = 200000.0 s and TMAX=200000.1 s will cause the algorithm
  2498.   to fail.  This is inherent in PGPLOT's use of single precision
  2499.   and cannot be avoided.  In such cases, you should use relative
  2500.   times if possible.
  2501.   
  2502.   PGTBOX's labelling philosophy is that the left-most or bottom tick of
  2503.   the axis contains a full label.  Thereafter, only changing fields are
  2504.   labelled.  Negative fields are given a '-' label, positive fields
  2505.   have none.   Axes that have the DD (or HH if the day field is not
  2506.   used) field on each major tick carry the sign on each field.  If the
  2507.   axis crosses zero, the zero tick will carry a full label and sign.
  2508.   
  2509.   This labelling style can cause a little confusion with some special
  2510.   cases, but as long as you know its philosophy, the truth can be divined.
  2511.   Consider an axis with TMIN=20s, TMAX=-20s.   The labels will look like
  2512.   
  2513.          +----------+----------+----------+----------+
  2514.       0h0m20s      10s      -0h0m0s      10s        20s
  2515.   
  2516.   Knowing that the left field always has a full label and that
  2517.   positive fields are unsigned, informs that time is decreasing
  2518.   from left to right, not vice versa.   This can become very 
  2519.   unclear if you have used the 'F' option, but that is your problem !
  2520.   
  2521.   Exceptions to this labelling philosophy are when the finest time
  2522.   increment being displayed is hours (with option 'Y') or days.  
  2523.   Then all fields carry a label.  For example,
  2524.   
  2525.          +----------+----------+----------+----------+
  2526.        -10h        -8h        -6h        -4h        -2h
  2527.   
  2528.   
  2529.   PGTBOX can be used in place of PGBOX; it calls PGBOX and only invokes 
  2530.   time labelling if requested. Other options are passed intact to PGBOX.
  2531.   
  2532.   Inputs:
  2533.    XOPT   :  X-options for PGTBOX.  Same as for PGBOX plus 
  2534.   
  2535.               'Z' for (DD) HH MM SS.S time labelling
  2536.               'Y' means don't include the day field so that labels
  2537.                   are HH MM SS.S rather than DD HH MM SS.S   The hours
  2538.                   will accumulate beyond 24 if necessary in this case.
  2539.               'X' label the HH field as modulo 24.  Thus, a label
  2540.                   such as 25h 10m would come out as 1h 10m
  2541.               'H' means superscript numbers with d, h, m, & s  symbols
  2542.               'D' means superscript numbers with    o, ', & '' symbols 
  2543.               'F' causes the first label (left- or bottom-most) to
  2544.                   be omitted. Useful for sub-panels that abut each other.
  2545.                   Care is needed because first label carries sign as well.
  2546.               'O' means omit leading zeros in numbers < 10
  2547.                   E.g.  3h 3m 1.2s rather than 03h 03m 01.2s  Useful
  2548.                   to help save space on X-axes. The day field does not 
  2549.                   use this facility.
  2550.   
  2551.    YOPT   :  Y-options for PGTBOX.  See above.
  2552.    XTICK  :  X-axis major tick increment.  0.0 for default. 
  2553.    YTICK  :  Y-axis major tick increment.  0.0 for default. 
  2554.              If the 'Z' option is used then XTICK and/or YTICK must
  2555.              be in seconds.
  2556.    NXSUB  :  Number of intervals for minor ticks on X-axis. 0 for default
  2557.    NYSUB  :  Number of intervals for minor ticks on Y-axis. 0 for default
  2558.   
  2559.    The regular XOPT and YOPT axis options for PGBOX are
  2560.   
  2561.    A : draw Axis (X axis is horizontal line Y=0, Y axis is vertical
  2562.        line X=0).
  2563.    B : draw bottom (X) or left (Y) edge of frame.
  2564.    C : draw top (X) or right (Y) edge of frame.
  2565.    G : draw Grid of vertical (X) or horizontal (Y) lines.
  2566.    I : Invert the tick marks; ie draw them outside the viewport
  2567.        instead of inside.
  2568.    L : label axis Logarithmically (see below).
  2569.    N : write Numeric labels in the conventional location below the
  2570.        viewport (X) or to the left of the viewport (Y).
  2571.    P : extend ("Project") major tick marks outside the box (ignored if
  2572.        option I is specified).
  2573.    M : write numeric labels in the unconventional location above the
  2574.        viewport (X) or to the right of the viewport (Y).
  2575.    T : draw major Tick marks at the major coordinate interval.
  2576.    S : draw minor tick marks (Subticks).
  2577.    V : orient numeric labels Vertically. This is only applicable to Y.
  2578.        The default is to write Y-labels parallel to the axis.
  2579.    1 : force decimal labelling, instead of automatic choice (see PGNUMB).
  2580.    2 : force exponential labelling, instead of automatic.
  2581.   
  2582.        The default is to write Y-labels parallel to the axis
  2583.    
  2584.   
  2585.          ******************        EXCEPTIONS       *******************
  2586.   
  2587.          Note that 
  2588.            1) PGBOX option 'L' (log labels) is ignored with option 'Z'
  2589.            2) The 'O' option will be ignored for the 'V' option as it 
  2590.               makes it impossible to align the labels nicely
  2591.            3) Option 'Y' is forced with option 'D'
  2592.   
  2593.          ***************************************************************
  2594.   
  2595.   
  2596.  
  2597. 2 PGTEXT -- write text (horizontal, left-justified)
  2598.       SUBROUTINE PGTEXT (X, Y, TEXT)
  2599.       REAL X, Y
  2600.       CHARACTER*(*) TEXT
  2601.   
  2602.   Write text. The bottom left corner of the first character is placed
  2603.   at the specified position, and the text is written horizontally.
  2604.   This is a simplified interface to the primitive routine PGPTXT.
  2605.   For non-horizontal text, use PGPTXT.
  2606.   
  2607.   Arguments:
  2608.    X      (input)  : world x-coordinate of start of string.
  2609.    Y      (input)  : world y-coordinate of start of string.
  2610.    TEXT   (input)  : the character string to be plotted.
  2611.  
  2612. 2 PGUPDT -- update display
  2613.       SUBROUTINE PGUPDT
  2614.   
  2615.   Update the graphics display: flush any pending commands to the
  2616.   output device. This routine empties the buffer created by PGBBUF,
  2617.   but it does not alter the PGBBUF/PGEBUF counter. The routine should
  2618.   be called when it is essential that the display be completely up to
  2619.   date (before interaction with the user, for example) but it is not
  2620.   known if output is being buffered.
  2621.   
  2622.   Arguments: none
  2623.  
  2624. 2 PGVECT -- vector map of a 2D data array, with blanking
  2625.       SUBROUTINE PGVECT (A, B, IDIM, JDIM, I1, I2, J1, J2, C, NC, TR,
  2626.      1                   BLANK)
  2627.       INTEGER IDIM, JDIM, I1, I2, J1, J2, NC
  2628.       REAL    A(IDIM,JDIM), B(IDIM, JDIM), TR(6), BLANK, C
  2629.   
  2630.   Draw a vector map of two arrays.  This routine is similar to
  2631.   PGCONB in that array elements that have the "magic value" defined by
  2632.   the argument BLANK are ignored, making gaps in the vector map.  The
  2633.   routine may be useful for data measured on most but not all of the
  2634.   points of a grid. Vectors are displayed as arrows; the style of the
  2635.   arrowhead can be set with routine PGSAH, and the the size of the
  2636.   arrowhead is determined by the current character size, set by PGSCH.
  2637.   
  2638.   Arguments:
  2639.    A      (input)  : horizontal component data array.
  2640.    B      (input)  : vertical component data array.
  2641.    IDIM   (input)  : first dimension of A and B.
  2642.    JDIM   (input)  : second dimension of A and B.
  2643.    I1,I2  (input)  : range of first index to be mapped (inclusive).
  2644.    J1,J2  (input)  : range of second index to be mapped (inclusive).
  2645.    C      (input)  : scale factor for vector lengths, if 0.0, C will be
  2646.                      set so that the longest vector is equal to the
  2647.                      smaller of TR(2)+TR(3) and TR(5)+TR(6).
  2648.    NC     (input)  : vector positioning code.
  2649.                      <0 vector head positioned on coordinates
  2650.                      >0 vector base positioned on coordinates
  2651.                      =0 vector centered on the coordinates
  2652.    TR     (input)  : array defining a transformation between the I,J
  2653.                      grid of the array and the world coordinates. The
  2654.                      world coordinates of the array point A(I,J) are
  2655.                      given by:
  2656.                        X = TR(1) + TR(2)*I + TR(3)*J
  2657.                        Y = TR(4) + TR(5)*I + TR(6)*J
  2658.                      Usually TR(3) and TR(5) are zero - unless the
  2659.                      coordinate transformation involves a rotation
  2660.                      or shear.
  2661.    BLANK   (input) : elements of arrays A or B that are exactly equal to
  2662.                      this value are ignored (blanked).
  2663.  
  2664. 2 PGVSIZ -- set viewport (inches)
  2665.       SUBROUTINE PGVSIZ (XLEFT, XRIGHT, YBOT, YTOP)
  2666.       REAL XLEFT, XRIGHT, YBOT, YTOP
  2667.   
  2668.   Change the size and position of the viewport, specifying
  2669.   the viewport in physical device coordinates (inches).  The
  2670.   viewport is the rectangle on the view surface "through"
  2671.   which one views the graph.  All the PG routines which plot lines
  2672.   etc. plot them within the viewport, and lines are truncated at
  2673.   the edge of the viewport (except for axes, labels etc drawn with
  2674.   PGBOX or PGLAB).  The region of world space (the coordinate
  2675.   space of the graph) which is visible through the viewport is
  2676.   specified by a call to PGSWIN.  It is legal to request a
  2677.   viewport larger than the view surface; only the part which
  2678.   appears on the view surface will be plotted.
  2679.   
  2680.   Arguments:
  2681.    XLEFT  (input)  : x-coordinate of left hand edge of viewport, in
  2682.                      inches from left edge of view surface.
  2683.    XRIGHT (input)  : x-coordinate of right hand edge of viewport, in
  2684.                      inches from left edge of view surface.
  2685.    YBOT   (input)  : y-coordinate of bottom edge of viewport, in
  2686.                      inches from bottom of view surface.
  2687.    YTOP   (input)  : y-coordinate of top  edge of viewport, in inches
  2688.                      from bottom of view surface.
  2689.  
  2690. 2 PGVSTD -- set standard (default) viewport
  2691.       SUBROUTINE PGVSTD
  2692.   
  2693.   Define the viewport to be the standard viewport.  The standard
  2694.   viewport is the full area of the view surface (or panel),
  2695.   less a margin of 4 character heights all round for labelling.
  2696.   It thus depends on the current character size, set by PGSCH.
  2697.   
  2698.   Arguments: none.
  2699.  
  2700. 2 PGWEDG -- annotate an image plot with a wedge
  2701.       SUBROUTINE PGWEDG(SIDE, DISP, WIDTH, FG, BG, LABEL)
  2702.       CHARACTER *(*) SIDE,LABEL
  2703.       REAL DISP, WIDTH, FG, BG
  2704.   
  2705.   Plot an annotated grey-scale or color wedge parallel to a given axis
  2706.   of the the current viewport. This routine is designed to provide a
  2707.   brightness/color scale for an image drawn with PGIMAG or PGGRAY.
  2708.   The wedge will be drawn with the transfer function set by PGSITF
  2709.   and using the color index range set by PGSCIR.
  2710.   
  2711.   Arguments:
  2712.    SIDE   (input)  : The first character must be one of the characters
  2713.                      'B', 'L', 'T', or 'R' signifying the Bottom, Left,
  2714.                      Top, or Right edge of the viewport.
  2715.                      The second character should be 'I' to use PGIMAG
  2716.                      to draw the wedge, or 'G' to use PGGRAY.
  2717.    DISP   (input)  : the displacement of the wedge from the specified
  2718.                      edge of the viewport, measured outwards from the
  2719.                      viewport in units of the character height. Use a
  2720.                      negative value to write inside the viewport, a
  2721.                      positive value to write outside.
  2722.    WIDTH  (input)  : The total width of the wedge including annotation,
  2723.                      in units of the character height.
  2724.    FG     (input)  : The value which is to appear with shade
  2725.                      1 ("foreground"). Use the values of FG and BG
  2726.                      that were supplied to PGGRAY or PGIMAG.
  2727.    BG     (input)  : the value which is to appear with shade
  2728.                      0 ("background").
  2729.    LABEL  (input)  : Optional units label. If no label is required
  2730.                      use ' '.
  2731.  
  2732. 2 PGWNAD -- set window and adjust viewport to same aspect ratio
  2733.       SUBROUTINE PGWNAD (X1, X2, Y1, Y2)
  2734.       REAL X1, X2, Y1, Y2
  2735.   
  2736.   Change the window in world coordinate space that is to be mapped on
  2737.   to the viewport, and simultaneously adjust the viewport so that the
  2738.   world-coordinate scales are equal in x and y. The new viewport is
  2739.   the largest one that can fit within the previously set viewport
  2740.   while retaining the required aspect ratio.
  2741.   
  2742.   Arguments:
  2743.    X1     (input)  : the x-coordinate of the bottom left corner
  2744.                      of the viewport.
  2745.    X2     (input)  : the x-coordinate of the top right corner
  2746.                      of the viewport (note X2 may be less than X1).
  2747.    Y1     (input)  : the y-coordinate of the bottom left corner
  2748.                      of the viewport.
  2749.    Y2     (input)  : the y-coordinate of the top right corner of the
  2750.                      viewport (note Y2 may be less than Y1).
  2751.  
  2752. 2 PGADVANCE -- non-standard alias for PGPAGE
  2753.       SUBROUTINE PGADVANCE
  2754.   
  2755.   See description of PGPAGE.
  2756.  
  2757. 2 PGBEGIN -- non-standard alias for PGBEG
  2758.       INTEGER FUNCTION PGBEGIN (UNIT, FILE, NXSUB, NYSUB)
  2759.       INTEGER       UNIT
  2760.       CHARACTER*(*) FILE
  2761.       INTEGER       NXSUB, NYSUB
  2762.   
  2763.   See description of PGBEG.   
  2764.  
  2765. 2 PGCURSE -- non-standard alias for PGCURS
  2766.       INTEGER FUNCTION PGCURSE (X, Y, CH)
  2767.       REAL X, Y
  2768.       CHARACTER*1 CH
  2769.   
  2770.   See description of PGCURS.
  2771.  
  2772. 2 PGLABEL -- non-standard alias for PGLAB
  2773.       SUBROUTINE PGLABEL (XLBL, YLBL, TOPLBL)
  2774.       CHARACTER*(*) XLBL, YLBL, TOPLBL
  2775.   
  2776.   See description of PGLAB.
  2777.  
  2778. 2 PGMTEXT -- non-standard alias for PGMTXT
  2779.       SUBROUTINE PGMTEXT (SIDE, DISP, COORD, FJUST, TEXT)
  2780.       CHARACTER*(*) SIDE, TEXT
  2781.       REAL DISP, COORD, FJUST
  2782.   
  2783.   See description of PGMTXT.
  2784.  
  2785. 2 PGNCURSE -- non-standard alias for PGNCUR
  2786.       SUBROUTINE PGNCURSE (MAXPT, NPT, X, Y, SYMBOL)
  2787.       INTEGER MAXPT, NPT
  2788.       REAL    X(*), Y(*)
  2789.       INTEGER SYMBOL
  2790.   
  2791.   See description of PGNCUR.
  2792.  
  2793. 2 PGPAPER -- non-standard alias for PGPAP
  2794.       SUBROUTINE PGPAPER (WIDTH, ASPECT)
  2795.       REAL WIDTH, ASPECT
  2796.   
  2797.   See description of PGPAP.
  2798.  
  2799. 2 PGPOINT -- non-standard alias for PGPT
  2800.       SUBROUTINE PGPOINT (N, XPTS, YPTS, SYMBOL)
  2801.       INTEGER N
  2802.       REAL XPTS(*), YPTS(*)
  2803.       INTEGER SYMBOL
  2804.   
  2805.   See description of PGPT.
  2806.  
  2807. 2 PGPTEXT -- non-standard alias for PGPTXT
  2808.       SUBROUTINE PGPTEXT (X, Y, ANGLE, FJUST, TEXT)
  2809.       REAL X, Y, ANGLE, FJUST
  2810.       CHARACTER*(*) TEXT
  2811.   
  2812.   See description of PGPTXT.
  2813.  
  2814. 2 PGVPORT -- non-standard alias for PGSVP
  2815.       SUBROUTINE PGVPORT (XLEFT, XRIGHT, YBOT, YTOP)
  2816.       REAL XLEFT, XRIGHT, YBOT, YTOP
  2817.   
  2818.   See description of PGSVP.
  2819.  
  2820. 2 PGVSIZE -- non-standard alias for PGVSIZ
  2821.       SUBROUTINE PGVSIZE (XLEFT, XRIGHT, YBOT, YTOP)
  2822.       REAL XLEFT, XRIGHT, YBOT, YTOP
  2823.   
  2824.   See description of PGVSIZ.
  2825.  
  2826. 2 PGVSTAND -- non-standard alias for PGVSTD
  2827.       SUBROUTINE PGVSTAND
  2828.   
  2829.   See description of PGVSTD.
  2830.  
  2831. 2 PGWINDOW -- non-standard alias for PGSWIN
  2832.       SUBROUTINE PGWINDOW (X1, X2, Y1, Y2)
  2833.       REAL X1, X2, Y1, Y2
  2834.   
  2835.   See description of PGSWIN.
  2836.