PLOT - Version 1.72L            February 26, 1993
                  ====================
 
  By:                 
  John Cordes                               
  Department of Physics
  Dalhousie University
  Halifax, N.S.
  Canada B3H 3J5
  Telephone: (902) 494-2313
  email: cordes@ac.dal.ca


  Copyright John Cordes 1990 - 93.  PLOT is freely distributable
  provided this document is distributed with the executable file
  PLOT172L.PRG.

         Bug reports, comments or suggestions are welcome.
  **********************************************************************

                     Brief  Description of PLOT:
                     ---------------------------

  PLOT is a two-dimensional plotting program for the Atari ST which runs
  in high or medium (ST) resolution.  Its main features are (1) that it
  can plot a large variety of functions entered at the keyboard, (2) it
  can plot data read from disk files or entered 'by hand' in a built-in
  data editor, and (3) it can produce good quality hardcopy on a variety
  of printers using GDOS printer drivers and fonts.  PLOT was developed
  in GFA Basic, Version 3; it is based on an earlier program I wrote in
  True Basic.  The present version (Plot 1.72L) is compiled in GFA
  v3.5E.

  'Any' number (i.e. no specific limit, just memory) of curves, in
  various line and marker styles, may be overlaid on a single plot; any
  combination of individual curves may be saved for printer output.

  Brief, context sensitive, on-screen help is available at many stages of
  the program at the touch of the <Help> key.  Some, but not all, of the
  information in the help screens will be repeated below; the user is
  urged to read carefully the information in the help screens themselves.

  **********************************************************************

   ==============  A More Detailed Description of PLOT  ==============

    Please note: Additional information may be obtained by scanning the
                 Revision History notes at the end of this file.

  When PLOT first starts up you are prompted to make a choice between
  (k)eyboard or (a)rray input. This essentially means: do you want to plot
  a function which you will type in at the keyboard ( keyboard input mode
  option) or plot a set of data points (array input)? In the latter case
  there will be a further prompt: should the data be read from a file, or
  do you want to go directly to the data editor to enter some points?

  Another possibility at startup is to hit the F1 function key, which
  takes you to a GEM screen, with a number of drop down menus.  There you
  can do such things as run an external program, set some of PLOT's
  options, check out which GDOS screen and printer fonts are available, or
  call on a set of numerical utilities.

  Returning to the command screen (Return to plots, UNDO or ^P from the
  GEM screen), where all the real work in PLOT is done, let's suppose
  you choose option (k), keyboard function entry.

                      1. Editing Keyboard Entry
     
  When you are being prompted for entry of a function or a numeric
  variable, the normal editing features are (usually) available: <Esc> to
  clear the field, Delete, Backspace and Arrow keys all work; in addition
  <Home> takes you to the beginning of the input string and <Control-Home>
  takes you to the end. <Control-Left Arrow> and <Control-Right Arrow>
  also move the cursor to the beginning and end, respectively, of the
  input field.

  When done entering a function (press the Help key at any time for
  guidance on the available functions and other matters), just press
  Return to get to the screen where the Plot Box parameters can be
  entered/modified; you can simply accept Plot's defaults with a single
  press of the Return key. See below (in Section 3: Function Plotting) for
  some examples of possible functions for typing in at the keyboard.

                        2.  The Plotting Box

  This program doesn't go in for automatic scaling!  The user is always
  prompted at the beginning of plot construction for the range of the
  plotting box (i.e.  xlower, xupper, ylower, yupper) and tick/label
  spacings, etc.  The actual *size* and *location* on screen of the
  plotting box can be set from the alternate (GEM) screen (the box
  coordinates are described in the next paragraph); also the
  presence/absence of the outer frame can be toggled from the menu bar.

  If you wish to change the default settings of the size and location of
  the plotting box on the screen, you should be aware that the coordinates
  used are pixels, measured relative to the upper left hand corner of the
  screen.  For the high resolution screen the range is 0 to 639 pixels
  horizontally and 0 to 399 pixels vertically.  For the medium resolution
  screen the range is 0 to 639 horizontally and 0 to 199 vertically.

  A brief rundown on the variables you will be prompted for in setting up
  the plotting box:

  XLOWER: x-coordinate of left edge of plotting box

  XUPPER: x-coordinate of right edge of plotting box

  XTICK: spacing of the minor tick marks.  If set to zero the x-axis will
   be omitted entirely.  If xtick < 0, there will be no major or minor
   ticks on the x-axis but there will still be ticks on the surrounding
   frame (which I refer to as the plotting box).

  XLABEL: spacing of the major tick marks.  The labels will be placed at
   the major ticks if xlabel > 0.  If xlabel = 0 there will be no major
   ticks or labels anywhere.  If xlabel < 0 there will be no labels but
   major ticks will occur at spacing ABS(xlabel).

      ***********   Summary of various tick/label settings  ***********

   1.  xtick>0,xlabel>0: Standard case.  Minor ticks at xtick; major
       ticks and labels at xlabel.
   2.  xtick=0,xlabel>0: Omit x-axis.  Major ticks and labels on box.
   3.  xtick<0,xlabel>0: Omits x-axis ticks.  Major/minor ticks/labels
       on box.
   4.  xtick>0,xlabel=0: No labels.  Only (minor) ticks at xtick.
   5.  xtick=0,xlabel=0: No x-axis, no ticks, no labels.
   6.  xtick<0,xlabel=0: No x-axis ticks.  Minor ticks on box; no
       labels.
   7.  xtick>0,xlabel<0: Omits labels; still have x-axis
       major/minor ticks.
   8.  xtick=0,xlabel<0: Omit x-axis.  Major ticks on box, no labels.
   9.  xtick<0,xlabel<0: No x-axis ticks.  Major/minor ticks on box; no
       labels.

   Of course, if the plot box (i.e.  the outer frame) is not being drawn
  (it can be toggled on/off in the alternate screen) some of the above
  statements must be modified in a reasonably obvious way.

  ********************************************************************
  YLOWER/YUPPER: Similar to xlower/xupper (see above).
  YTICK/YLABEL:  Similar to xtick/xlabel (see above).

  GRAIN: This parameter determines the number of function evaluations,
   i.e.  the fineness of the 'mesh'.  The recommended range is (4..2000),
   but the actual lower limit is 1, while the upper limit is constrained
   by the available memory in your machine, at least for screen plotting.
   I have tried grain = 10,000 with no problem.  However, saving a curve
   for printer output is another matter.  At the moment there is a hard
   coded constraint of a little less than 10,000 for the total number of
   function values which can be saved for later GDOS printing; if there
   are arrays involved the x-coordinates need to be stored as well.

  LINE STYLE/THICKNESS: The best way to find out about the line styles
   available is to run the program and use the Help key to read help
   screen number 3.  The line thickness should be an odd number in the
   range 1..35.  No harm is done by entering an even number but you won't
   get it!  Also, if the line thickness chosen is anything greater than
   one, the style reverts to the simple solid line (style 1).  Therefore,
   to get one of the styles 2..6 you must enter 1 for the line thickness.

   The available line styles are:
       1 = Solid
       2 = Long dash
       3 = Dot
       4 = Dash,dot
       5 = Dash
       6 = Dash,dot,dot.

  The negative line styles are used to access the individual point
  plotting mode.  E.g.  entering line style -8 (negative 8) results in a
  small solid box being plotted at each of the mesh points; no connecting
  line is drawn in this case.  See help screen 3 for descriptions of the
  other 7 point styles.

   Available marker (point) styles are:
       -1 = Dot (.)
       -2 = Plus (+)
       -3 = Asterisk (*)
       -4 = Square ([])
       -5 = Diagonal Cross (X)
       -6 = Diamond (<>)
       -7 = Solid box
       -8 = Small solid box

 
  GRID: This parameter controls whether or not a pattern of grid lines
   will appear on the plot. If set to 1, a mesh of horizontal and
   vertical grid lines will appear at the major tick intervals; if grid
   is set to 0 (the default) no grid lines appear. The line style for the
   grid may also be chosen (styles 1-6).

                      3.  Function Plotting

  In addition to the standard arithmetic operators +, -, *, /, ^, the
  following functions of the single variable x are supported: SIN, COS,
  TAN, ASIN, ACOS, ATN, EXP, LOG, SQR, SINH, COSH, ABS, SGN, GAMMA, and
  HVS (Heaviside step function: HVS(x) is defined to be equal to 1 for x
  >= 0 and to be 0 for x < 0.).  In addition, two kinds of Bessel
  functions are supported at present: BSJ(a,x) - the Bessel function of
  the first kind (usually called BesselJ(a,x), or J(a,x)) and BSI(a,x) -
  the modified Bessel function I(a,x). The Bessel functions accept real
  constants a (>=0) for the order; however, if the order entered is
  non-integer, x will be restricted to values >=0.  The Airy function,
  AI(x) (x positive or negative), is also supported.

  The function parser is not case sensitive - the function names are shown
  in upper case in this document simply for easy visibility.  [See also
  below for the INTEGRATE command].

  The maximum allowed length for a function is around 380 characters or
  so.  It's not the parser that's limited to any particular length, but
  rather the limitation comes about from what is then done with the
  function - e.g.  plotting of a very long function is more likely to
  cause a problem (such as error messages, followed by an exit from the
  program, quite possibly) than using the expression evaluator. I have
  successfully plotted functions with 387 characters, and have used longer
  functions in the expression evaluator.

  Some effort is made to trap singular behaviour so that, for example, the
  function 1/x can be plotted in a solid line style over a region spanning
  the origin.  Some mathematical liberties are taken in the process, so
  that, for example, if a plot of SQR(x) is requested in the range -5 < x
  < 5, the plot is given properly for positive x but nothing is shown in
  the region where x is negative and the square root doesn't exist (in the
  domain of real numbers).  The lesson here is that in certain cases the
  apparent plotting of a zero value should not necessarily be taken to
  mean that the function is actually zero there!  In addition you should
  be warned that if you try taking a *function* of SQR(x) (such as
  SIN(SQR(x)) or BSJ(1,SQR(x)), say ), with negative values of x being
  required in the plotting range, a fatal error may well occur; the
  program will quite likely quit abruptly and ungracefully exit back to
  the desktop (or shell or whatever). Sorry about that.

  Some examples of functions which could be entered at the (k)eyboard
  prompt are:

  SIN(pi*x/4) - Ordinary trigonometric function
  BSJ(1,x^2)   - Bessel function J(1,x^2)
  BSJ(.5,x)    - Bessel function of order 1/2
 .5*HVS(3+x)*HVS(3-x) - Draws a sort of 'top hat' function in range (-3,3)


                       4.  Integration

  An additional possibility in function plotting mode is to plot the
  integral of a function, from a specified lower limit to the variable
  upper limit x.  The syntax for this is to enter INTEG(f(x),a) where f(x)
  can be composed of the functions listed above and 'a' is the lower limit
  of the integral.  So for example

  INTEG(.5*BSJ(1,x),0) - Integrates (1/2) times the Bessel function
                         J(1,x), with lower limit of integration 0.

        x 
       / 
  i.e. | dx [0.5*J(1,x)] will be plotted as a function of x.
       / 
       0


  SIN(pi*x)*INTEG(BSJ(1,x),0)/COS(x) is also allowed. (Try to avoid
  dividing by a zero value though, since an error will likely occur.)

  However, the integration cannot occur as the argument of some other
  function, so:
   
       SIN(INTEG(x,0)) is ILLEGAL.

  The rule is simply that there must not be parentheses around the INTEG.

  HINT: If a syntax error is reported (e.g.  missing parenthesis or Bessel
  function index not a constant) when entering a function, and you have
  trouble getting rid of the error message no matter how you edit your
  function, try exiting function entry mode (use ESC to clear the edit
  line and enter a backslash '\'), then go into (k)eyboard mode and try
  again.

                    5.  Coordinate  Mode

  When the function has been plotted the console bell will sound and you
  will see a notice on the screen to the effect that pressing <Esc> will
  take you into coordinate mode.  If you accept this invitation the mouse
  cursor will become a crosshair with which you can read off the (x,y)
  coordinates of any point on the screen.  This feature is especially
  handy for finding zeros of functions, or the x-value at which two curves
  cross.

                   Saving the Coordinates:
  After clicking the mouse at a point on the plot, if you press the <s>
  key, a little message will flash on the screen saying 'saved'.  This
  means that the coordinates of that point have been recorded for possible
  later saving in a disk file.  When you exit coordinate mode with another
  <Esc>, if any 'saves' have been made you will be asked if you really
  want to save a file and then be prompted for a disk file name (in an
  item selector box - the default extension .COO doesn't have to be used);
  the file is a simple ascii file with a list of the coordinate pairs
  selected.

  If you do not want to enter coordinate mode, just touch another key,
  such as the space bar.  If you exit (or bypass) coordinate mode without
  meaning to you can still press <Esc> later to re-enter coordinate mode.

                       6. After Coordinate Mode

 (a).  Pressing <Help> gives access to the 9 built-in help screens, as
  usual.

 (b).  Pressing <F1> takes you directly to the 'alternate screen'.  This
  is a screen with a standard drop-down menu bar, from which various
  parameters may be set or utilities accessed.  Access to desk accessories
  is also available here.  Under File there are options to save a plot as
  an uncompressed Degas file (.PI3 or .PI2, depending on the resolution),
  or to run an external program.  The printer device number can also be
  altered from the default value (21) in this screen.

 (c).  Pressing <L> enters legend mode. Assuming you are running with GDOS
  active, you will be prompted first for the Font ID number to be used.
  This will be, for example, 2 for a Swiss font, 14 for a Dutch font, etc.
  If you don't know the ID numbers for the fonts you have available, don't
  despair! By going to the GEM screen (with the F1 key) and selecting
  Fonts... under the Printer menu heading, PLOT will load the disk-based
  screen and printer fonts available and present a table of those found.
  The screen fonts will have the appropriate Font ID's listed for each
  face; make a note of the ID numbers for future reference. The tables
  will show the point sizes available for each typeface. After specifying
  the typeface to be used by entering a Font ID, next enter the point
  size.  For comparison, the axis labels in PLOT are in Swiss 18 point.
  For best results, try to use a point size for which you have both screen
  and printer fonts available.

  You will be prompted to enter some text.  When done press <Return> and
  you will be asked whether the legend, or floating label, should be
  horizontal or vertical.  After answering that query, you can move the
  legend around the screen with the mouse - click with the left button to
  'deposit' the text on the screen at the desired places.  When you have
  finished clicking press <Esc> to 'paste' down your choices, or <Undo> to
  remove all the legends just deposited. Sorry, but there is at the
  present no way to move (or remove) floating labels once they have been
  pasted in place. You may notice that the labels are not always
  immediately re-drawn on the screen after some activity; they will
  (usually!) appear 'soon' and in any case will almost certainly be
  printed. You can press <L> again to add further legends or proceed to
  step (d).

  (d).  Pressing <S> is essentially a 'continue' command: you will be
  asked whether you want to save this curve for printing (this assumes
  GDOS is present in the system; if it isn't this prompt will be
  bypassed); assume for now that you answer no.  You will then be asked if
  you want to change the plot parameters (if this is the first curve in
  the plot) or if you want to plot any more curves (if this is not the
  first curve or if you have finished trying new settings for the plot
  parameters (such things as xlower, grain, style, etc.).

                          7.  Array  Plotting

  Choosing, at startup, option (a) for array plotting presents the user
  with a further choice: reading a data file off disk (f) or using the
  simple built-in data editor (e). Then, either (option (f)) a file
  selector box will appear (default extender ".ASC") for choosing a data
  file, or option (e) lands you in the data editor.

  If a data file is read in you will be told the number of points read
  (the maximum number allowed is 2048) and then given the option of
  looking at or modifying the data in the editor, transforming the data in
  various ways, or plotting the data either 'as is' or with fitted curves
  (a linear fit, a polynomial fit (more about this later), a fast cubic
  spline which passes through all the data points, or a smoother (but MUCH
  slower) spline fit which doesn't necessarily pass through the data
  points.  For this latter option (ArrayOp 4) the spline order may be
  input - the allowed values are 1, 2, or 3 (e.g.  this last would mean
  the spline is with cubic curves).  More details on these options may be
  found below.

           =============  Data  Files  ====================

  The format of the data files is illustrated in the following examples
  (see also the file SAMPLE1.ASC, which should be included in this
  distribution):

  ; comment1: this data file might be output from a Fortran program, say.
  ; comment2
  .
  .
  .
  ; commentN
  .27 3.4
  1e-11 4e12
  0 0
  11 -.1

  Any number of comment lines may occur at the BEGINNING of the file. The
  *first* character on a comment line must be a semi-colon <;> . After
  this come the x-y coordinate pairs.  The separators may be spaces (any
  number) or a comma; the separator type should not be mixed in a single
  file, however; i.e.  don't use commas for some coordinate pairs and
  spaces only for other pairs.  The following is ok, though:

  .27, 3.4
   1,2
    -2.5, 7 

   i.e.  when a comma is (consistently) used as the separator there may
   also be leading/trailing spaces on the x and y values.

                     Summary of Array Options:
                     =========================

 ArrayOp 0: Just pressing <Return> at the Array Ops menu gives this by
  default.  Plots the data points 'as is'.  This allows for using
  individual markers for the data points (use a negative line style) or
  drawing a continuous curve through the points (as in function plotting).

 ArrayOp 1: Linear fit - a simple least squares straight line fit.  The
  slope(m) and intercept(b) are shown on the screen with the fitted line.
  There is no way to recover these values once this screen has been left.
  At the moment this option is somewhat superfluous since option 2 (see
  below) can be used with degree set to 1.

 ArrayOp 2: Polynomial fit - the user is prompted for the degree of the
  polynomial to be used (this is the exponent of the highest power of x in
  the polynomial).  E.g.  a(1)+a(2)*x+a(3)*x^2 has degree 2, and 3
  coefficients to be determined, so at least 3 data points are required.
  If you enter a degree which is greater than one less than the number of
  data points the program sets degree=Ndatapoints -1.  The fitting is done
  by a singular value decomposition of the 'design' matrix, rather than
  directly solving the so-called normal equations.  This SVD technique is
  slower (and takes a lot more code) than using the normal equations but
  is much more informative and reliable (see, e.g.  Numerical Recipes, by
  Press, Flannery, Teukolsky and Vetterling, p.518 in the Fortran volume).
  After entering the desired degree for the fitting polynomial you will be
  asked for the range of x - values over which the polynomial should be
  drawn (you may only want the fitted curve to be shown in the
  neighbourhood of the data points rather than over the whole range of the
  plotting box).  Then the curve will be plotted.

              Viewing the Fitting Parameters and Singular Values
              --------------------------------------------------

   After finishing with the coordinate display mode and pressing <S> to
  move on, you will be asked if you want to see the results of the fitting
  routine.  Here you see not only the polynomial coefficients but also the
  singular values of the design matrix.  Some of these may have been set
  to zero by the program because they fall below the limit set by the
  relative error tolerance.  PLOT uses a default tolerance of 1.0E-06;
  this may be modified while you are on the fitting parameters screen by
  pressing <Control-T>.  (The new value will stay in effect until the
  present series of plots is completed unless of course the value is
  edited again.) When you leave the parameters screen the fitting
  parameters and the coefficients are lost, so write them down if you need
  them!  However, the polynomial coefficients can optionally be saved into
  a file before leaving this screen.

   The next query is whether anything more is to be done with the data?
  Answer yes if you want to plot the individual points (Option 0), try a
  different fitting routine, use the data editor, etc.

  ArrayOp 3: This is a fast cubic spline interpolation through all the
  data points.  PLOT will prompt for xmin and xmax values for drawing the
  resulting curve.

  ArrayOp 4: This is a slow spline fit (not just interpolation) to the
  data.  It is so slow that it is probably impractical for data sets with
  more than about 15 - 20 points, say (unless you are very patient!).  The
  order of the spline is input by the user; 3 is a cubic spline (but *not*
  the same as option 3 - try it out and see).

            *********************************************************

                            8.  Printing

  Good quality hard copy is possible if GDOS is present in the machine and
  a suitable printer driver plus font files are available on disk.  The
  default device number for the printer driver (the number used in your
  ASSIGN.SYS file) is 21 - this can be altered with a drop down menu
  selection in the alternate screen; if you *are* going to alter the
  device number I strongly recommend that you do it when starting up PLOT,
  before you forget (the voice of experience speaking...). The program has
  been tested with the 9-pin driver FX80.SYS (on a Citizen 120D), the
  24-pin driver LQ800.SYS (on a Star NX-2400 and an Epson LQ500) and the
  Atari laser printer driver SLM804.SYS (on an SLM804; I haven't tried it
  on an SLM605 but assume it will work).

  If GDOS is present, (it, or a replacement, such as G+Plus must have been
  loaded at boot time by being in the AUTO folder), you will be prompted
  at a suitable stage to see if a given curve should be saved for
  printing.  I will elaborate a little on this: You can overlay as many
  curves as you please in a single plot, and any or all curves can be
  tagged for plotting.  This means that the selected curves, together with
  any floating labels/legends which you may have added to the plot via the
  <L> key, will be printed on a single plot, after you have declared that
  no more curves are to be added to the plot.

    Warning: saving array plots can be deceptive. The way things are set
    up at the moment, only one curve is saved (the most recent) for each
    data array that is read in. This means that if you want to plot both
    the 'raw' data points and a cubic spline fit, and have both curves
    printed, you must load the data file twice: the first time plot the
    points only (ArrayOp 0) and save the curve for printing, the second
    time plot the cubic spline (ArrayOp 3) and save that curve for
    printing.

  You can also save the plot to a file GEMFILE.GEM by 'printing' with
  device number set to 31 (metafile) - the ASSIGN.SYS file must contain
  the metafile driver META.SYS for this to work.  This file can then be
  printed with Migraph's OUTPRINT.PRG; I don't particularly recommend
  trying to do much with the file in EASYDRAW itself, you'll find it's
  pretty 'messy'. 

  [If GDOS is NOT present the only reasonable prospects for hardcopy are
  either saving as a Degas picture or doing a screendump with Alt-Help;
  SNAPSHOT.ACC doesn't get along well with PLOT at all.]

  At the time when a curve is first selected for printing, PLOT will go to
  disk and look for the printer driver according to the device number
  chosen (default: 21).  This number should match the number given to the
  printer driver in the ASSIGN.SYS file.  If the driver is found PLOT will
  offer some default scaling factors for both the horizontal and vertical
  directions, appropriate to the resolution of the device to which you are
  planning to send the output.  These typically result in a printed plot
  of about 5.5" (horizontal) by 4.5" (vertical) on a 24-pin printer and
  about 4.25" by 3.25" on a 9-pin printer; this assumes that you have not
  altered the default plotting box size for the on-screen display.  Your
  results may vary, however; do some experimenting with the scale factors!
  The printouts look much better on the 24-pin printers (using Migraph's
  printer drivers) than on the 9-pin -- at least, that's been my
  experience.

           =============  ASSIGN.SYS files ================

  I usually use the same ASSIGN.SYS file used by EASYDRAW.  The actual
  printer driver and font files must be available on disk in the location
  shown in the PATH variable (in the ASSIGN.SYS example file below the
  fonts and driver would be in folder GEMSYS on drive A:).

  PATH = A:\GEMSYS\
  ; Change A: to drive with \GEMSYS\ folder
  00p screen.sys
  ; --START OF SCREEN FONTS--
  01p screen.sys
  02p screen.sys
  03p screen.sys
  ; list your medium res screen fonts here.
  04p screen.sys
  ; list your screen fonts for the ST mono screen here.
  ; -- START OF PRINTER FONTS --
  ;21 FX80.SYS     ; Epson 9-pin and compatibles printer driver
  ; SWISS (Sans Serif) 9-pin printer fonts
  ;EPSHSS07.FNT
  ;ATSS10EP.FNT
  ;ATSS12EP.FNT
  ;EPSHSS14.FNT
  ;ATSS18EP.FNT 
  ;ATSS24EP.FNT
  ;EPSHSS28.FNT
  ;EPSHSS36.FNT
  21 LQ800.SYS   ; Epson 24-pin and compatibles printer driver
  ; SWISS  24-pin printer fonts
  P24MSS07.FNT
  ATSS10SP.FNT
  ATSS12SP.FNT
  ATSS18SP.FNT
  ATSS24SP.FNT
  P24MSS36.FNT
  ; METAFILE
  31r META.SYS

                             Memory
                             ------

  Memory can be a problem in using GDOS and its associated drivers and
  fonts.  When PLOT is first run it displays the free memory remaining -
  this figure must be at least around 330K for the 9-pin or 24-pin drivers
  to work.  If you're close to the limit you may only get a few fonts
  loaded; also I'm not sure what happens if the memory is very tight and
  you try to save several curves for printing on the same plot - one or
  two curves should be alright. I have tried to put in a fair amount of
  intelligent error trapping in case insufficient memory is found, but
  it's always possible you could have a crash.

  In some tests with the SLM804 I used a Mega-4 and allocated over 3
  Megabytes for the GDOS stuff (combination of the large printer
  resolution and many fonts in the ASSIGN.SYS file).  1.4 Megabytes or so
  will allow several SLM804 printer fonts (and the SLM driver). The
  minimum memory required to allocate to the laser printer driver itself
  (no fonts) seems to be about 980,000 bytes, though in some tests I've
  seen this go as low as 940,000 bytes.  The additional memory required by
  each font to be loaded corresponds quite well to the size of the font
  file itself.  The order of fonts in your ASSIGN.SYS file is the order in
  which fonts will be loaded (this is true on my system anyway, using
  G+Plus; I don't know if it's universally true), so if there are 2 or 3
  printer fonts you want to be available, list them first. You can use the
  Font display feature of PLOT (function key F8 in the GEM screen) to
  experiment a little with some of this; the information may also be
  useful for operating other GDOS based programs. Be warned that if you
  set the memory to be reserved for the program too low a crash will
  result, requiring a re-set.
  
 **********************************************************************

                      Revision History
                      ================

1.72L:
  1. Fixed a couple of places where the path information introduced in
     v1.72H was getting lost.

1.72J:
  1. Speeded up data window scrolling with the arrow keys.

1.72I:
  1. Changed screen input routine for the range limits in cubic spline
     fit plotting, to allow for arrays which might have x-coords such as
     2E13; previously such a large number would not have been displayed
     correctly.

1.72H:
  1. In array plotting mode, it's now allowed to go in and out of
     cross-hair mode (with the ESC key) repeatedly.

  2. Introduced new path saving features for data files and running
     external programs. The program is now much more convenient to use
     when several data files are to be read from some folder.

1.72E: 
  1. Changed the GDOS printer device detection routine to recognize more
     printers, including the DeskJet 500.

  2. Minor improvements to the data editor window handling, especially
     for cases where the number of data points is 17 (the maximum which
     can be displayed in the window at a time) or a little over.

  3. Fixed a recently appearing bug which messed up the invocation of the
     data editor without a data file having being read in.

1.72A:
  1. Corrected a bug in the data file reading routine whereby the last 
     line of data was missed if there was no blank line at the end of
     the file.

1.72:
  1. Grid lines may now be put on the plot.

  2. Automatic sorting of data arrays is no longer done. Sorting was added
     in v1.52, but was concealed from the user. As of version 1.72,
     sorting is an option available in the data editor screen by pressing
     the <s> key. This should speed up operations on large arrays which
     don't need sorting. Note that if you insert points (in the data
     editor) out of order, it will be advisable to do a sort before
     leaving the editor if you plan to plot in a continuous line style; if
     you're just going to plot individual points then there's no need to
     do a sort.

  3. Keyboard controls have been introduced for scrolling the data editor
     window, to complement the usual mouse operated scroll bar. Up/down
     arrows scroll one line at a time, shift up/down scroll by a
     screenful, and Home/Shift-Home move to the beginning/end of the
     array.

1.71:
  1. Many of the information boxes resulting from menu selections in the
     GEM screen have been re-written as conventional GEM dialog boxes
     (with embedded code, so there's still no .RSC file with PLOT).

  2. Legends, or floating labels as they are sometimes called, now make
     use of GDOS screen fonts, if GDOS is active. Any of the typefaces
     and point sizes available may be used. Lists of the (GDOS) screen
     and printer fonts and point sizes available may be viewed under the
     Printer menu heading in the GEM screen (or function key F8).

1.68:
    1. The modified Bessel functions BSI(order,x) now allow a real, not
       just integer, constant for the order.

    2. The Airy function, Ai(x), is now built in. It's evaluation is
       expensive, since it is calculated in terms of fractional order
       Bessel functions, which are themselves much more time consuming
       than integer order Bessel functions.

1.66:
    1. Changed GDOS printer driver detection routine to allow a range of
       resolutions for each class of printer; these had previously been
       hardcoded to specific values (e.g. INTOUT(0) = 2399 for the
       SLM804).

1.65:
    1. Fixed bug which caused program to quit if the (d)efault option
       was used at the plot parameters screen.

    2. A few changes were made concerning the entry of very long
       functions in keyboard mode. There should now be less chance
       of overflow onto a second line.

    3. A problem which sometimes arose in calculating Bessel functions
       of order 2.5 and greater, for x > 25, has been fixed.

1.64a:
    1. The configuration file has been extended to include the functions
       in the history buffer, as well as the GDOS device number. Config
       files can be saved (^G) and loaded (Alt-G) at the alternate GEM
       screen. As before, if a config file is called PLOT.CFG and is 
       located in the directory from which PLOT is run, it will be 
       automatically read in at startup.

1.60:
    1. The INTEGration feature has been enhanced by allowing for
      additional functions to appear before and after the integral,
      e.g. it is now permissible to do

         sin(x)*integ(x,0)/pi

       The integral cannot, however, appear as the argument of a
       function, so there should never be parentheses around
       integ(x,a).

    2. The Bessel functions BSJ (Bessel functions of the first kind)
       now accept real constants (not just integer) for their order.
       This enables one to use the root-finding capability in PLOT
       (Alt-Z at the GEM menu bar screen) to find the zeros of
       spherical Bessel functions, since they are the same as the
       zeros of half-integer order J's. The real constant for the
       order must be non-negative, and if the order is indeed
       non-integer, the function BSJ will only return sensible values
       for non-negative x. It should be noted that the Bessel function
       calculation with fractional order is much slower than in the
       case of integer order; I will be attempting to optimize this
       somewhat but am not expecting very significant improvements.
       Technical note:  the integer order Bessel function calculations
       are done using polynomial approximations, but for fractional
       order a backwards recursion calculation is carried out.

    3. The saving of functions into the function history buffer can be
       toggled with Alt-F. If one of the previously saved functions is
       called up, using the up- and/or down-arrow keys, any edits to
       that function are automatically saved. This means that even
       when function saving is OFF, the previously saved functions
       always contain the most recently used set of parameters.
     
    4. In the Calculator, or expression evaluating, mode (Alt-C in
       the alternate screen), a feature has been added to make it
       simpler to repeatedly evaluate a function at different values
       of x. Just type a vertical bar (Shift-backslash) right after
       the function and then type the numerical value of x at which
       you want the function evaluated.  For example
            sin(x)|22
       will return the value of sin(22), and the cursor will
       automatically be positioned after the bar, ready for input of
       another value.
     
    5. The small solid box style (style number = -8) has been made
       twice as big, so that printouts on a laser printer would turn
       out better. The problem is that on the SLM804 the default line
       thickness for curves is one, but that is too fine (in most
       cases) on the laser, so I find it better to go to line
       thickness 3. But then the small solid box didn't show up very
       well over the thicker solid line, consequently I've rather
       arbitrarily doubled the size of the small box. The effects of
       this have not been tested on a dot-matrix printer; hope it
       doesn't cause anybody a problem.

    6. It was sometimes a nuisance not being able to get back into
       coordinate reading mode, once it had been exited or by-passed.
       It is now possible to just hit <Esc> anytime after coordinate
       mode has been left, or by-passed, until the <S> key has been
       pressed. It's in fact easy now to go repeatedly into and out of
       coordinate mode, whenever you're at the 'bare' plot, i.e. no
       other prompt is requesting input at the time.

    7. The GAMMA function (syntax: gamma(x)) has been added. This
       enables the factorials to be accessed, through the relation
       Gamma(n+1)=n!

    8. I have begun to explore the possibilities of a config file, to
       at least partially customize the setup of PLOT for a
       particular user. So far all that is possible is to have a one
       line ascii file, PLOT.CFG, containing a single number which is
       the printer device number, for GDOS printing. Since PLOT comes
       with a default device number of 21, some users might wish to
       create a file containing the number 23, for instance, if their
       ASSIGN.SYS file assigns 23 to their printer driver (otherwise
       you have to remember to change the device number in the
       drop-down menu screen). The presence of the file PLOT.CFG will
       be checked for when PLOT is first run (in the directory from
       which PLOT is run) and, if present, will be read.

1.50:
              1. pi (=3.14159...) can be used in function entry,
          though not when you're being prompted for a *constant*.
          Thus, for example, pi/2*cos(pi*x/2) is a legal function
          entry, but xupper=pi/2 is not allowed.

              2. A function history buffer is now built in, so that
          (up to 20) previously entered functions can be scrolled
          through with the up/down arrow keys when you're being
          prompted for function entry. (Function saving can be
          toggled in v1.60).

              3. A new menu item, Numeric, appears on the alternate
          (GEM) screen. Here you'll find several useful utilities:

                 Calculator: An expression evaluator.  Just type in any
            (numerical) expression, such as sin(22), 2.5*bsj(0,pi/2),
            etc.  and the result will be displayed.  If an 'x' appears
            anywhere it will be taken to be 0. (See new stuff for
            v1.60 for an improvement).

                 Zeros: Computes zeros for functions entered at the
            keyboard.  e.g.  you could enter the function (at the y:
            prompt) 'x^2-9', or something much more complicated.  You
            will also have to enter the beginning and end of the
            x-interval (x1 and x2) which will be searched, and specify
            if one (option 0) or 'all' (option 1) roots are wanted.
            What does this mean?  Well, if all roots are requested
            (the default case), the grain setting (defaults to 100) is
            used to divide the interval (x1,x2) into sub-intervals and
            any sub-intervals for which the function has opposite sign
            at the two ends will result in a zero being found.  If
            only one zero is requested, the first zero will be located
            (assuming f(x1)*f(x2) < 0).

                 Integration: A numerical integration routine, using 20
            point Gaussian quadrature in each panel.  The number of
            panels into which the interval is divided has a default
            value of 1, but can be altered easily.  If more than 10
            panels are set, intermediate (cumulative) results are
            shown after each 10 panel set is completed.  In most
            cases, you'll soon find that accuracy is rarely increased
            by setting more than 1 or at most a few panels.

                 Polynomial Roots: Here a polynomial (of degree up to
            size 20) can be entered.  Only univariate (single variable) 
            polynomials are allowed, but the coefficients may be
            complex.  The (possibly complex) roots are then computed
            and displayed.

              While in any of these numerical utilities, screen output
          may be paused (usually) by pressing any key (other than
          Escape - see next sentence) (any key resumes).  Pressing
          <Esc> aborts the current operation.  For example, if you
          want to cut short the computation of zeros of some function,
          pressing <Esc> aborts and returns you to the function entry
          line.

         Also: Fixed a bug whereby a (c)ontinue after printing
          hardcopy (with GDOS) messed up screen output (some plot size
          parameters needed resetting after the workstation output).

1.42:
          Fixed a small problem where sometimes the user would be
          prompted for curve printing even when no curves had been
          saved for printing.  This only happened after a (c)ontinue
          sequence.

1.41:
          The Help screens (accessible by pressing the <Help> key)
          are now available at the ArrayOps screen.

              Changed the default printer device number (for GDOS) to
          21 for the high resolution screen (it used to be set to 23).
          Now 21 is used for both cases: monochrome and colour
          monitors.

1.34:
          Corrected a problem where there was some confusion as to
          whether the data editor should show the transformed or
          untransformed data.  Found that the GFA Interpreter has a
          bug to do with arrays, but things are OK in the compiled
          version.  Same problem occurs with the 3.5E interpreter.

1.33:     Fixed some problems with line thicknesses for the curves
          occasionally interfering with box frame thickness.

1.30:     Changed method of inputting plotting box parameters
          (xlower..yupper, line style, etc.) from the 'line at a time'
          approach to a full screen editing approach.  Now a single
          <Return> accepts all the defaults and gets on with the job.

1.26:     Added save to disk feature for coordinate pairs read off
          the plot.

1.25:     Added save to disk feature for the polynomial fit
          parameters.

1.23:     <t>rim feature added to editor.  This enables a data array
          to be reduced (trimmed) in size.  In the data editor,
          pressing the <t> key puts up a small box in which four
          parameters are set.  These are:
   (1) nstart - the number of the first data point to be retained.
   (2) nstop - the number of the last data point to be retained (with a
       possible exception if lastpoint is set).
   (3) ntrim - the trim spacing.  E.g.  if nstart=2 and ntrim=3, then
       every third point will be retained, starting with the second.
       Thus the points retained in this example are 2,5,8,...  .
   (4) lastpoint - Setting this to 1 forces the last (of the original
       data set) point to be retained; leaving it at the default of 0
       means that the trimmed array will terminate at whatever data pair
       occurs at a value of nstart+(integer)*ntrim which is less than or
       equal to nstop.
     Note that this trimming procedure can be used to delete any
   contiguous blocks of data, by using ntrim=1 and suitable values for
   nstart and nstop.  The deletions occur only in memory, not on disk.
   They cannot be undone, except by reading in the disk file again.