home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / fortran77_210 / pgplot / !PGPlot / HelpPGPlot < prev    next >
Encoding:
Text File  |  1994-02-28  |  96.4 KB  |  2,258 lines

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