home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / graphics / basplot.lbr / BASPLOT.DZC / BASPLOT.DOC
Encoding:
Text File  |  1991-06-25  |  62.4 KB  |  1,456 lines

  1.                            <<<  Plotting Program  >>>
  2.  
  3.                                  User's Manual.
  4.  
  5.  
  6. Glossary
  7. --------
  8.  
  9. (One good picture is worth thousand words....)
  10.  
  11. 1) When we say "x-axis horizontal" the other say "landscape",
  12.    when we say "x-axis vertical" the others say "portrait":
  13.  
  14.    .-----------------------------.              .------------------.
  15.    |                             |              |                  |
  16.    |                             |              |                  |
  17.    |                             |              |                  |
  18.    |          Landscape          |              |     Portrait     |
  19.    |                             |              |                  |
  20.    |                             |              |                  |
  21.    |                             |              |                  |
  22.    `-----------------------------'              |                  |
  23.    (x-axis parallel to the longer               |                  |
  24.    side of the drawing paper)                   |                  |
  25.                                                 `------------------'
  26.                                            (x axis parallel to the shorter
  27.                                            side of the drawing paper)
  28.  
  29.      History: On the "platen" plotters the platen was always as the "Landscape" 
  30.           so the x axis was always parallel to the longer side of the paper 
  31.           (when standing in the front of the plotter) and if somebody wanted 
  32.           graph in the "Portrait" mode then the x axis was vertical and the y 
  33.           axis horizontal.
  34.  
  35. 2) axis, labels, legend, title, and notes:
  36.  
  37.      ----------------------------------      axis
  38.  
  39.      -----+-----+-----+-----+-----+----      axis with ticks
  40.  
  41.      -----+-----+-----+-----+-----+----      axis with ticks and
  42.           1     2     3     4     5          labels
  43.  
  44.      -----+-----+-----+-----+-----+----      axis with ticks,
  45.           1     2     3     4     5          labels, and
  46.              this is axis legend             legend (centered)
  47.  
  48.      -----+-----+-----+-----+-----+----      axis with ticks,
  49.           1     2     3     4     5          labels,
  50.              this is axis legend             legend (centered), and
  51.      Fig. 1: TEST PLOT                       plot title (left justified)
  52.  
  53.      -----+-----+-----+-----+-----+----      axis with ticks,
  54.           1     2     3     4     5          labels,
  55.              this is axis legend             legend (centered),
  56.      Fig. 1: TEST PLOT                       plot title (right justified), and
  57.      Dotted line represents ....             notes (always left justified)
  58.      Dashed line represents ....
  59.  
  60.      The "notes" are allowed only in the x-axis vertical plots (so called "por-
  61.      trait").
  62.  
  63.      The plot title is always placed below the x-axis and can be either
  64.      centered or left justified (with the y-axis).
  65.  
  66.      The axis labels are (sort of) centered around the corresponding tick.
  67.  
  68.      The default plot is the "x-axis horizontal".  The same plot can be
  69.      drawn with "x-axis vertical" - no RO-tate function is used.
  70.  
  71.                              -----===<<#>>===-----
  72.  
  73.  
  74. Simplified program flow chart for PLOT.BAS
  75. ------------------------------------------
  76.  
  77.                            .------------------------.
  78.                            | SELECT PLOTTING OPTION |
  79.                            |        OR EXIT         |
  80.                            `-----------v------------'
  81.                                        |
  82.                                        V
  83.                                  .------------.
  84.                                  | DATA INPUT |
  85.                                  `-----v------'
  86.                                        |
  87.                                        V
  88.     .----------------.         .---------------.
  89.     | Option 4 only: |<--------| CHECK OPTIONS |<---------------------.
  90.     | DATA TO ENTER? |         `-------v-------'                      |
  91.     `-----v----v-----'                 |                              |
  92.        NO |    | YES                   |                              |
  93.           |    `---------------------->O-----------------.            |
  94.           |                            |                 |            |
  95.           |                            V                 V            |
  96.           |                    .--------------.  .---------------.    |
  97.           |                    | TYPE IN DATA |  | USE DATA FILE |    |
  98.           |                    `-------v------'  `-------v-------'    |
  99.           |                            |                 |            |
  100.           |                            V                 V            |
  101.           |                      .-----------------------------.      |
  102.           |                      | REVIEW AND CORRECT THE DATA |      |
  103.           |                      `-----------------------------'      |
  104.           |                            |                              |
  105.           |                            V                              |
  106.           |                  .--------------------. YES               |
  107.           |                  | MORE DATA TO ENTER |-------------------'
  108.           |                  `---------v----------'
  109.           |                            |
  110.           |                            | NO
  111.           |                            V
  112.           |                 NO .----------------.
  113.           |              .-----| Option 2 or 3? |
  114.           |              |     `----------------'
  115.           |              |             |
  116.           |              |             | YES
  117.           |              |             V
  118.           |              |   .-------------------.
  119.           |              |   | DO CALCULATION OF |
  120.           |              |   |    COEFFICIENTS   |
  121.           |              |   `---------v---------'
  122.           |              |             |
  123.           |              |             |
  124.           |              V             V
  125.           |          .------------------------------------.
  126.           `--------->| CONTINUE WITH GRAPHICS SCREEN PLOT |
  127.                      `------------------------------------'
  128.  
  129.  
  130. Simplified program flow chart for PLOT01.BAS
  131. --------------------------------------------
  132.  
  133.                               .-----------------.
  134.                               | GRAPHICS SCREEN |
  135.                               |     ROUTINES    |
  136.                               `--------v--------'
  137.                                        |
  138.                                        V
  139.                               .-----------------.  NO
  140.                               | PLOT ON SCREEN? |----------------------.
  141.                               `--------v--------'                      |
  142.                                        |                               |
  143.                                        | YES                           |
  144.                                        V                               |
  145.                               .-----------------.                      |
  146.                    .--------->| SCREEN PLOTTING |<---------.           |
  147.                    |          |    AREA SETUP   |          |           |
  148.                    |          `--------v--------'          |           |
  149.                    |                   |                   |           |
  150.                    |                   V                   |           |
  151.                    |          .-----------------.          |           |
  152.                    |          | PLOTTING LIMITS |          |           |
  153.                    |          |      SETUP      |          |           |
  154.                    |          `--------v--------'          |           |
  155.                    |                   |                   |           |
  156.                    |                   V                   |           |
  157.                    |       NO  .----------------.          |           |
  158.                    `-----------| READY TO PLOT? |          |           |
  159.                                `----------------'          |           |
  160.                                        |                   |           |
  161.                                        | YES               |           |
  162.                                        V                   |           |
  163.                                     .------.               |           |
  164.                                     | PLOT |               |           |
  165.                                     `------'               |           |
  166.                                        |                   |           |
  167.                                        V                   |           |
  168.                              .--------------------.  YES   |           |
  169.                              | MORE DATA TO PLOT? |--------'           |
  170.                              `--------------------'                    |
  171.                                        |                               |
  172.                                        | NO                            |
  173.                                        V                               |
  174.                          .---------------------------.                 |
  175.                          | CHECK THE PLOTTING OPTION |                 |
  176.                          |      PLOT ON PLOTTER?     |                 |
  177.                          `---------------------------'                 |
  178.                              |                    |                    |
  179.                              | NO                 | YES                |
  180.                              V                    V                    |
  181.             .---------------------.          .------------------.      |
  182.             | DATA ENTRY ROUTINES |          | GRAPHICS PLOTTER |<-----'
  183.             `---------------------'          |     ROUTINES     |
  184.                                              `------------------'
  185.  
  186.  
  187. Simplified program flow chart for PLOT02.BAS
  188. --------------------------------------------
  189.  
  190.                               .------------------.
  191.                               | GRAPHICS PLOTTER |
  192.                               |     ROUTINES     |
  193.                               `--------v---------'
  194.                                        |
  195.                                        V
  196.                              .-------------------.
  197.                              | SELECT OUTPUT AND |
  198.                              |    SET FLAGS      |
  199.                              `---------v---------'
  200.                                        |
  201.                                        V
  202.                                .---------------.
  203.                       .------->| PLOTTER SETUP |<---------------------.
  204.                       |        |   ROUTINES    |                      |
  205.                       |        `-------v-------'                      |
  206.                       |                |                              |
  207.                       |                |                              |
  208.                       |                V                              |
  209.                       |       .-----------------.                     |
  210.                       |       | PLOTTING LIMITS |                     |
  211.                       |       |      SETUP      |                     |
  212.                       |       `--------v--------'                     |
  213.                       |                |                              |
  214.                       |                V                              |
  215.                       |   NO   .----------------.                     |
  216.                       `--------| READY TO PLOT? |                     |
  217.                                `-------v--------'                     |
  218.                                        | YES                          |
  219.                                        |                              |
  220.                     .------------------^---------------.              |
  221.                     |                                  |              |
  222.                     V                                  V              |
  223.               .-----------.                 .--------------------.    |
  224.               | DATA FILE |                 | SETUP SERIAL PORT  |    |
  225.               `-----v-----'                 | INITIALIZE PLOTTER |    |
  226.                     |                       `----------v---------'    |
  227.                     |                                  |              |
  228.                     V                                  V              |
  229.            .-----------------.                      .------.          |
  230.            | COMMAND STRINGS |                      | PLOT |          |
  231.            |  TO DATA FILE   |                      `--v---'          |
  232.            `--------v--------'                         |              |
  233.                     |                                  |              |
  234.                     `-----------------v----------------'              |
  235.                                       |                               |
  236.                                       V                               |
  237.                      .-----------------------------------.  YES       |
  238.                      | MORE DATA TO PLOT OR REPEAT PLOT? |------------'
  239.                      `-----------------------------------'
  240.                                       | NO
  241.                                       V
  242.                               .------------------.
  243.                               | CHAIN DATA ENTRY |
  244.                               |     ROUTINE      |
  245.                               `------------------'
  246.  
  247.                              -----===<<#>>===-----
  248.  
  249.  
  250. 1. Introductory notes.
  251.    -------------------
  252.  
  253. The whole program consists of three sub-programs:
  254.  
  255.      PLOT.COM - routines to enter experimental data and data manipulation,
  256.      PLOT01.COM - routines for graphics screen,
  257.      PLOT02.COM - routines for graphics plotter.
  258.  
  259. In addition some utilities are provided with the program.  These are:
  260.  
  261.      SDUMP.BAS - a program to dump the graphics screen into a data file,
  262.      SLOAD.BAS - a program load the graphics screen from a data file,
  263.      RDPLT.BAS - a program to read a file containing the command lines for the 
  264.           Hewlett-Packard plotter and send these through a serial port to the 
  265.           plotter (with xon/xoff handshake),
  266.      PLOT04.BAS - an example program to create a file for the user define func-
  267.           tion plot.  This program creates data file PLOT04.DAT which will be 
  268.           read by PLOT01.COM and PLOT02.COM.
  269.      The source codes are supplied for these utilities and can easily be changed 
  270.      to suit the user's system.
  271.  
  272. The following files will be created during the program run:
  273.  
  274.      PLOT.FLG - communication flags for PLOT*.COM files; random access, binary 
  275.           file, record length 2 bytes (integers), max 12 records,
  276.      PLOT.$$$ - temporary data file created by PLOT.COM; random access, binary, 
  277.           record length 4 bytes (real numbers), max  640 records,
  278.      PLOT0?.DAT - (? stands for 2 or 3) temporary data file created by PLOT.COM; 
  279.           random access, record length 4 bytes (real numbers), max 3600 records,
  280.      PLOT0?.SET - (? stands for 2 or 3 or 4) temporary data file created op-
  281.           tionally by either PLOT01.COM or PLOT02.COM containing settings for 
  282.           the graphics (screen and plotter); random access, binary, 1 record 40 
  283.           bytes of length.
  284.      PLOT03.DOC - temporary file created by PLOT.COM; sequential, ascii, vari-
  285.           able record length, max 8 records, containing coefficients for the 
  286.           linear regression analysis.
  287.  
  288. More about all these files in PLOT.bas, PLOT01.bas and PLOT02.bas.
  289.  
  290. The source code is for Microsoft Basic Compiler version 5.3 and has to be compi-
  291. led with an option /C (relax line numbering).  Unless you have al least 60kb of 
  292. available TPA do not use switch /O.  All three files, PLOT.BAS and PLOT01.BAS 
  293. and PLOT02.BAS, have to be compiled the same way.  For those who would like to 
  294. use the Basic interpreter the following modifications have to be made:
  295.  
  296. 1) All comment lines have to be removed.
  297. 2) Line numbers (labels) have to be added.  This should not be very difficult.
  298. 3) The arguments of the CHAIN statements have to be changed.
  299.  
  300. The program when compiled as supplied will run on a system comprising of 6MHz 
  301. Z80B CPU, Televideo terminal, graphics card addressable at 240 (data) and 241 
  302. (status) using graphics codes compatible with Microangelo Graphics Card , serial 
  303. Z80-SIO port addressable at 132 (data) and 133 (status) with CTC at 137 (if baud 
  304. change is required) to which a plotter which uses the Hewlett-Packard Graphics 
  305. Language (HPGL) is attached.  (Note: the addresses given are decimal.)
  306.  
  307. The program uses direct access to the port and does x-on/x-off handshake.  The 
  308. routine for the 8251 UART is also supplied (commented out).  All is quite well 
  309. documented in the source files.
  310.  
  311. The minimum requirement is a terminal with the Televideo screen attributes for 
  312. the program to run as is without any modification.  The output has then to be 
  313. directed to a data file, which is sequential ASCII file, which will contain all 
  314. the commands strings that would be otherwise send to a plotter.  The user can 
  315. later transfer the file into a system with a facility to plot using HPGL (laser 
  316. printer with HP card).
  317.  
  318.                              -----===<<#>>===-----
  319.  
  320. 2. Compiling the program.
  321.    ----------------------
  322.  
  323. When listing the source codes use the Compressed Mode (15 characters per inch) 
  324. on your printer.  The lines are 120 characters long.
  325.  
  326. Suggested compiling (syntax is for the BASCOM version 5.3 and Link-80 version 
  327. 3.44):
  328.  
  329. a) for systems with less than 60kb of TPA available (BRUN module required)
  330.  
  331.      BASCOM PLOT=PLOT/C/Z
  332.      BASCOM PLOT01=PLOT01/C/Z
  333.      BASCOM PLOT02=PLOT02/C/Z
  334.      L80 PLOT,PLOT/N/E
  335.      L80 PLOT01,PLOT01/N/E
  336.      L80 PLOT02,PLOT02/N/E
  337.  
  338. b) for systems with more than 60kb of TPA (stand alone command files, BRUN mo-
  339.      dule not required)
  340.  
  341.      BASCOM PLOT=PLOT/C/Z/O
  342.      BASCOM PLOT01=PLOT01/C/Z/O
  343.      BASCOM PLOT02=PLOT02/C/Z/O
  344.      L80 PLOT,PLOT/N/E
  345.      L80 PLOT01,PLOT01/N/E
  346.      L80 PLOT02,PLOT02/N/E
  347.  
  348. When successfully compiled, the .REL files can be deleted, .BAS files archived, 
  349. backup copies of .COM files made, and the program can be run.  The program with 
  350. all associated data files needs about 130kb of disk space.
  351.  
  352.                              -----===<<#>>===-----
  353.  
  354.  
  355. 3. INSTRUCTIONS AND EXPLANATIONS.
  356.    ------------------------------
  357.  
  358. NOTE: During the program run only a limited checking is provided on users en-
  359. tries and no "sophisticated" error routines are employed.  I have considered 
  360. that the user is intelligent enough.  The famous BASIC's "Redo from start" will 
  361. appear after erroneous entry with all its consequences - messages and prompt 
  362. strings will be out of sequence on the screen.  The program can be built fool-
  363. proof but at high cost of program size.
  364.  
  365.  
  366. 3.1. The Main Menu.
  367.      --------------
  368.  
  369. The program is run by typing PLOT at the console.  Note that the upper case let-
  370. ters are required for answers.  The default answer will appear in parentheses
  371. like (Y) which means that pressing ENTER has the same effect as typing Y and
  372. then pressing ENTER.  The user should be aware that only a limited checking is 
  373. done for the correctness of answers.  Assuming all is all right the following 
  374. menu will appear on the screen:
  375.  
  376. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  377.                            <<<  Plotting Program  >>>
  378.                                    MAIN MENU
  379.      Select from the following:
  380.      --------------------------
  381.      1. Plot experimental points
  382.      2. Plot experimental points and draw a smooth
  383.         curve through the points using spline functions
  384.      3. Plot experimental points, do linear regression
  385.         analysis and draw a regression line or curve
  386.      4. Plot user defined function through
  387.         experimental points
  388.      5. Exit this program
  389.  
  390.  Type the number of your selection: 1
  391. \__________________________________________________________________________/
  392.  
  393. Explanation:
  394.  
  395. Choice 1: Max of 8 data sets, each max of 40 x,y-pairs, are allowed.  The pro-
  396.      gram will plot and, if experimental errors are supplied (as average rela-
  397.      tive error or relative error of each value taken from a data file), a rec-
  398.      tangle corresponding dimensionally to relative x and y errors will be drawn 
  399.      around each experimental point.
  400.  
  401. Choice 2: Only one set of data with max of 40 x,y-pairs is allowed.  The program 
  402.      will calculate spline functions coefficients (third degree polynomials, li-
  403.      terature references about the spline functions subroutine given in PLOT.BAS 
  404.      file), points for spline function curve (400 points), first and second de-
  405.      rivatives (of the spline functions!) and then will plot experimental points 
  406.      (with their relative errors if  so required) and will draw a smooth curve 
  407.      through the points.  The user can choose to plot spline curve or the first 
  408.      derivative or the second derivative or all three functions.
  409.  
  410. Choice 3: Only one set of data with max of 40 x,y-pairs is allowed.  All data 
  411.      entered must be non-zero and positive, and the minimum number of x,y-pairs 
  412.      entered is 4.  A limited check on validity of data is performed but it is 
  413.      expected that the user is intelligent enough to know the use of regression 
  414.      functions.  It saves time and quite a lot of coding.  The program will cal-
  415.      culate regression coefficients for eight models (like parabolic, hyperbo-
  416.      lic, exponential, logarithmic, linear, quadratic), then it will plot expe-
  417.      rimental points (with or without relative errors) and then it will draw 
  418.      regression function (the user can choose the function with the best fit to 
  419.      the data).
  420.  
  421. Choice 4: Here the data entry is optional; if there are data then up to 8 sets 
  422.      of data with max of 40 x,y-pairs is allowed.  The program will plot the 
  423.      data (with or without relative errors - if supplied) and then will draw 
  424.      user defined function from a data file which has to be prepared before this 
  425.      program is run.  The default file name is PLOT04.DAT and the structure of 
  426.      the file is exactly the same as for PLOT03.DAT - described in PLOT.BAS.
  427.  
  428. Here in the MAIN MENU only integers 1 to 5 will be accepted and anything else 
  429. will cause the prompt "Type the number of your selection:" to appear again.  
  430. When the selection is made the user is then prompted to make a choice where to 
  431. plot:
  432.  
  433. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  434.  
  435.  
  436.  
  437.      1. Plot on the Graphics Screen
  438.      2. Plot on the plotter
  439.  
  440.           Type the number of your selection: 2
  441.  
  442. \__________________________________________________________________________/
  443.  
  444. Explanation:
  445.  
  446. Choice 1: This selection will utilize only the graphics screen.  The program is 
  447. setup for the Microangelo Graphics Board (or compatible) which has data port ad-
  448. dress at 240 and status port address at 241.  If your system is different and 
  449. you wish to utilize these graphics routines then some or all the graphics codes 
  450. in PLOT01.BAS will have to be changed.  What you have to supply is:
  451.  
  452.           a) the way to output and input data to and from the card, (subroutine 
  453.              5000),
  454.  
  455.           b) code for clear graphics and reset alpha cursor, (subroutine 5040),
  456.  
  457.           c) code to set position of alpha cursor, (subroutine 5050),
  458.  
  459.           d) code to set graphic cursor to given coordinates, (subroutine 5060),
  460.  
  461.           e) code to reset the graphics card but not to clear graphics, (subrou-
  462.              tine 5070),
  463.  
  464.           f) code to draw a line from current position to given position, (sub-
  465.              routine 5080),
  466.  
  467.           g) code to print a character at given position of graphics cursor, 
  468.              (subroutine 5090),
  469.  
  470.           h) code to set character mode, size, direction and video mode, (subro-
  471.              utine 5100),
  472.  
  473.           i) codes for graphics screen dump and load, (subroutines 1550 and 
  474.              1560), but if your system does not support that then simply insert 
  475.              "RETURN:'" after the subroutines labels),
  476.  
  477.           j) code for page-edit/page-display, (subroutine 6000).
  478.  
  479.      More details about all that in PLOT01.BAS.  If you have a terminal which 
  480.      can also display (pixel) graphics that you will have to insert subroutine 
  481.      which will switch at required times graphics display and text display.
  482.  
  483. Choice 2: The output will be directed either to a data file or to a plotter 
  484.      (using standard HPGL).  The user will be prompted later in the program.
  485.    
  486. Here only integers 1 or 2 will be accepted and anything else will cause the 
  487. prompt "Type the number of your selection:" to appear again.  When the selection 
  488. is made then the program continues with the Data Entry routines.
  489.  
  490.  
  491. 3.2.1. Data entry routines.
  492.        --------------------
  493.  
  494. As you can see we have chosen option 1, the "Experimental data plot".  The se-
  495. lection menu for the data input may appear like this:
  496.  
  497. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  498. <>                 Plot of experimental points                <data entry>
  499.  
  500.  
  501.           Select from the following:
  502.           --------------------------
  503.           1. Keyboard data entry
  504.           2. Data entry from a data file
  505.  
  506.  
  507.           The number of your selection: 1
  508.  
  509. \_________________________________________________________________________/
  510.  
  511. Explanation:
  512.  
  513. On the very first line on the screen is a header which informs about which data 
  514. file is in use (left side), what is going to be plotted (middle), and the rou-
  515. tine (right side).  Only two choices are displayed but in the case of plotting 
  516. the user defined function there is an option of no data entry - simply by pres-
  517. sing the ENTER key.
  518.  
  519.      Here, if the plotting options no. 1 to 3 were chosen, only the numerals 1 
  520. or 2 are accepted and anything else will cause the prompt to be re-displayed.  
  521. However, if the option no. 4 was chosen, (the "User's function plot") then an 
  522. additional option is available, which is NO DATA ENTRY (plot function from a 
  523. data file).
  524.  
  525.  
  526.  
  527. Data input from the keyboard.
  528. -----------------------------
  529.  
  530.      The selection was made to type-in the data.  The following menu will be 
  531. displayed:
  532.  
  533. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  534. <PLOT.$$$>            Plot of experimental points             <data entry>
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542. How many data pairs for plot no. 1: 10
  543. \__________________________________________________________________________/
  544.  
  545. Explanation:
  546.  
  547. Very little checking is provided here; the number of data pairs should be at 
  548. least one and at most forty.  less than one and more than forty will cause the 
  549. prompt to be re-displayed.  The use should note that for the options 2 and 3 
  550. there is a minimum of 4 data pairs to be entered.  Failing that will cause the 
  551. program to abort later during the calculation of the coefficients.
  552.  
  553. The user will be prompted to enter each value.  The data correction and review 
  554. routine will follow after this routine, i. e., after each data set entered.
  555.  
  556.      After the last Y entry the screen may appear like this:
  557.  
  558. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  559. <PLOT.$$$>          Plot of experimental points           <keyboard entry>
  560.  
  561.      X( 6 ) = 6
  562.      Y( 6 ) = 36
  563.      X( 7 ) = 7
  564.      Y( 7 ) = 49
  565.      X( 8 ) = 8
  566.      Y( 8 ) = 64
  567.      X( 9 ) = 9
  568.      Y( 9 ) = 81
  569.      X( 10 ) = 10
  570.      Y( 10 ) = 100
  571.  
  572.  
  573.  
  574.           Review and correct the data (Y/N)? Y
  575.  
  576. \__________________________________________________________________________/
  577.  
  578. Explanation:
  579.  
  580. Here the user has to answer by capital Y or N.  Anything else will cause re-
  581. display of the prompt.
  582.  
  583.      The N answer will cause this routine to be skipped and the program, depen-
  584. ding on the plotting choice will either ask for more data (options to plot expe-
  585. rimental data only or to plot user defined function through experimental data) 
  586. or will calculate coefficients for functions (spline functions or linear regres-
  587. sion options) to be plotted.
  588.  
  589.      By answering Y the data correction and review routine is started.
  590.  
  591.  
  592. 3.2.2. Data correction and review routine.
  593.        -----------------------------------
  594.  
  595. The screen may look similar to this:
  596.  
  597. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  598. <PLOT.$$$>            Plot of experimental points             <data review>
  599.  
  600.           Type the correct data or press RETURN!
  601.      X( 1 , 1 ) = 1 ? 
  602.      Y( 1 , 1 ) = 1 ? .99
  603.                 :
  604.                 :
  605.                 :
  606.                 :
  607. \__________________________________________________________________________/
  608.  
  609. Explanation:
  610.  
  611. The user has a choice of entering a correction after the prompt (question mark) 
  612. or pressing the ENTER key to leave the entry unchanged.  After the last entry 
  613. the prompt asking for data review and correction is displayed again.  Note, that 
  614. data pairs cannot be ADDED to the set just entered.
  615.  
  616. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  617. <PLOT.$$$>            Plot of experimental points           <keyboard entry>
  618.      X( 1 , 2 ) = 2 ? 
  619.      Y( 1 , 2 ) = 4 ? 
  620.      X( 1 , 3 ) = 3 ? 
  621.      Y( 1 , 3 ) = 9 ? 
  622.      X( 1 , 4 ) = 4 ? 
  623.      Y( 1 , 4 ) = 16 ? 16.5 
  624.      X( 1 , 5 ) = 5 ? 
  625.  
  626.           Review and correct the data (Y/N)? N
  627. \__________________________________________________________________________/
  628.  
  629.      This time we will answer N because we want to enter the data for the second 
  630. set.  On the screen will appear the prompt which has to be answered with capital 
  631. Y or N:
  632.  
  633.      Another set (no. 2 ) to enter (Y/N)? Y
  634.  
  635. It should be noted that for options to plot spline functions or regression fun-
  636. ctions only one set of data (max 40 x,y-pairs) is allowed and the program will 
  637. automatically proceed with calculations of coefficients.  The user, in that 
  638. case, will not be prompted for another set of data.
  639.  
  640.      The program goes back to the data Entry Menu and the user is prompted again 
  641. to select either to type the data in or to take the data from a specified data 
  642. file.  This time we will input the data from a data file.
  643.  
  644.  
  645. Data input from data file.
  646. --------------------------
  647.  
  648. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  649. <PLOT.$$$>             Plot of experimental points              <data entry>
  650.  
  651.      Select from the following:
  652.      --------------------------
  653.           1. Keyboard data entry
  654.           2. Data entry from a data file
  655.  
  656.  
  657.      The number of your selection: 2
  658. \__________________________________________________________________________/
  659.  
  660. The data entry from a data file was selected and the user is prompted to enter 
  661. the name of that data file.  It should be noted that the dat file must be of 
  662. random access, binary, record length 4 bytes (real number storage space).  NO 
  663. checking is provided for data existence.  The name of the file must be entered 
  664. in the UPPER case.  Again, no checking on legality of names is done here.  Acco-
  665. rding to the Microsoft Basic convention, if the named file does not exist then 
  666. the one is created and unwritten data are "read".  Illegal filename will cause 
  667. the program to abort.  It is assumed here that the user is "literate" in Basic 
  668. enough to know where to use upper case letters.  Alternatively, rushed users may 
  669. finished with a number of files with their names in lower case letters....
  670.  
  671. The screen for the data entry from a data file may appear like this:
  672.  
  673. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  674. <PLOT.$$$>             Plot of experimental points              <data entry>
  675.  
  676.  
  677.  
  678.  
  679. The name of the INPUT data file: JUNK.DAT
  680.  
  681.      Start with the pair no.: 1
  682.      Finish with the pair no.: 10
  683. \__________________________________________________________________________/
  684.  
  685. The structure of the data file was already mentioned.  The data are read from 
  686. the nominated file and after that the user is prompted to review and correct the 
  687. read data (the Data correction and Review routine):
  688.  
  689. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  690. <JUNK.DAT>               Plot of experimental points        <data from file>
  691.  
  692.  
  693.  
  694. Review and correct the data (Y/N)? Y
  695. \__________________________________________________________________________/
  696.  
  697. The data can be reviewed:
  698.  
  699. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  700. <PLOT.$$$>              Plot of experimental points            <data review>
  701.  
  702.           Type the correct data or press RETURN!
  703.      X( 2 , 1 ) = 1 ? 
  704.      Y( 2 , 1 ) = 1.85 ? 
  705.      X( 2 , 2 ) = 2 ? 
  706.      Y( 2 , 2 ) = 4.1 ? 
  707.      X( 2 , 3 ) = 3 ? 
  708.      X( 2 , 8 ) = 8 ? 
  709.      Y( 2 , 8 ) = 15.85 ? 
  710.      X( 2 , 9 ) = 9 ? 
  711.      Y( 2 , 9 ) = 18.1 ? 
  712.      X( 2 , 10 ) = 10 ? 
  713.      Y( 2 , 10 ) = 19.75 ? 
  714. \__________________________________________________________________________/
  715.  
  716. And after the last entry the user is asked again:
  717.  
  718.           Review and correct the data (Y/N)? N
  719.  
  720. This time we answer N (mind the case).  Another prompt will appear:
  721.  
  722.           Another set (no. 3 ) to enter (Y/N)? N
  723.  
  724. For the demonstration purpose two sets of data is enough.  It should be mention-
  725. ed at this stage, that when the data are entered from the keyboard the user is 
  726. asked whether the x-values or the y-values are the same as in the preceding set.  
  727. If they are then the user does not have repeat those entries.  However, if the 
  728. number of data pairs does not agree then either zeros are automatically entered 
  729. (when the preceding set has lower number of data pairs) or only the entries up 
  730. to the stated number of the pairs are automatically entered.  The user is then 
  731. left with an option to review and correct the missing data.
  732.  
  733. By answering N to the question about another set of data, the program will con-
  734. tinue with graphics screen routines.
  735.  
  736.  
  737. 3.3. Graphics Screen Plot.
  738.      ---------------------
  739.  
  740.      When there is no more data to be entered and all the coefficients have been 
  741. calculated, then the user, if his chosen plotting option was to use the plotter, 
  742. will be prompted to plot on the graphics screen:
  743.  
  744.           Plot on Graphics Screen too (N)? Y
  745.  
  746. The default answer is N (not to use the graphics screen - the user has chosen to 
  747. use the graphics plotter), but by pressing Y (mind the case) the program will 
  748. plot on the graphics screen first.  We have pressed Y so the program will plot 
  749. on the graphics screen before using the plotter.
  750.  
  751.  
  752. 3.3.1. Graphics Screen Plotting Area Setup.
  753.        ------------------------------------
  754.  
  755. Here start setup routines for the graphics screen setup.  The first setup screen 
  756. will look similar to this:
  757.  
  758. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  759. <>                  Plot of experimental points              <Screen set-up>
  760.  
  761.      Total plotting area is 512 X 490 abs. units.
  762.      The default plotting area (in abs. units): 410 X 410
  763.  
  764.      X(start), abs. units:   61
  765.      X(end), abs. units:    471
  766.      Y(start), abs. units:  458
  767.      Y(end), abs. units:    458
  768.  
  769.           OK (Y)? N
  770. \__________________________________________________________________________/
  771.  
  772. Explanation and notes:
  773.  
  774. The term "total plotting area" means the maximum number of points (also called 
  775. pixels) on the graphics screen which can be addressed.  The "default plotting 
  776. area" is the area on the graphics screen which is limited by the x and y axis.  
  777. Labels and legend (there is only one legend allowed which also serves as the 
  778. title) are outside of this area.
  779.  
  780. The default answer is Y which means that by pressing ENTER (or anything else 
  781. apart from N) the displayed values will be taken by the program for calcula-
  782. tions.  
  783.  
  784. By pressing N (mind the case) the user has an option of changing these values.  
  785. There is no check on validity of the user supplied data - it is expected that 
  786. when the user wants to change defaults he knows what he is doing.  Two frames 
  787. will be drawn on the graphics screen; one around the whole screen showing the 
  788. total plotting area, and second showing the user selected area for the axis 
  789. (called "default plotting area").
  790.  
  791. This routine is repeated until the user is "completely satisfied".  When this is 
  792. so then the program continues with selection of data sets and functions.
  793.  
  794.  
  795. 3.3.2. Data selection routine.
  796.        -----------------------
  797.  
  798. The user is prompted to select which data set or which function to plot.  The 
  799. screen will appear similar to this:
  800.  
  801. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  802. <>                   Plot of experimental points             <Screen set-up>
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.      There are 2  set(s) of data. Which set to plot? 1
  810. \__________________________________________________________________________/
  811.  
  812. Explanations:
  813.  
  814. Well, we entered two sets of data earlier so we have a choice which set to plot.  
  815. If the choice on the Main Menu was to plot spline functions or regression analy-
  816. sis (both selections allow only one set of experimental points) then the prompt 
  817. will be different:
  818.  
  819. a) spline functions plot:
  820.  
  821.      "Type F to plot f(x), D1 to plot f'(x), D2 to plot f''(x):"
  822.  
  823.    where f(x) is the spline function
  824.          f'(x) is the first derivative (of the spline function)
  825.          f''(x) is the second derivative (of the spline function)
  826.  
  827. b) regression analysis plot:
  828.  
  829.      "1.   Y=A+B*X       "
  830.      "2.   Y=A+B/X       "
  831.      "3. 1/Y=A+B/X       "
  832.      "4.   Y=B*X^2       "
  833.      "5.   Y=A*exp(B*X)  "
  834.      "6.   Y=A*X^B       "
  835.      "7.   Y=A+B*ln(X)   "
  836.      "8.   Y=A+B*X+C*X^2 "
  837.  
  838.      "Type the number of your selected regression model:"
  839.  
  840. c) user defined function: (display is the same like for the "Plot experimental      
  841.    points" option)
  842.  
  843.  
  844. 3.3.3. Plotting limits selection routine.
  845.        ----------------------------------
  846.  
  847. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  848. <>                    Plot of experimental points               <set no.: 1>
  849.  
  850.          X(0), (user units):    = 0   
  851.          Y(0), (user units):    = 0   
  852.  
  853.          X(MIN), (user units):  = 1    
  854.          X(MAX), (user units):  = 10  
  855.          Y(MIN), (user units):  = 1   
  856.          Y(MAX), (user units):  = 100 
  857.  
  858.          X-divisions:           = 10  
  859.          Y-divisions:           = 10  
  860.  
  861.      min of F(x), (user units): = 0
  862.      max of F(x), (user units): = 0
  863.  
  864.           OK (Y/N)?N
  865. \__________________________________________________________________________/
  866.  
  867. Explanation and notes:
  868.  
  869. X(0),Y(0) are the X and Y coordinates of the point of intersection of axis,
  870.  
  871. F(x) is a function to be plotted; here we have chosen to plot experimental 
  872.      points only - that means no function to be calculated and plotted, but, the 
  873.      points can be connected by a line.
  874.  
  875. All numerical data can be changed apart from the min and max of the function.  
  876. The data for that are displayed here only for the user information to chose 
  877. proper plotting limits.
  878.  
  879. Here the user has to answer Y or N (mind the case) to proceed further.  Answer Y 
  880. if the limits are suitable and you wish to proceed with the next routine, or 
  881. answer N to change the limits.  By answering N to the prompt the following 
  882. prompt will appear:
  883.  
  884.      "Type K to use keyboard, D data file for graphics screen setup:"
  885.  
  886. This means that we have an option of changing limits manually (from the key-
  887. board) or take the limits from a file prepared beforehand.  Since we have not 
  888. prepared any file of that sort we have to select K and enter all limits manu-
  889. ally.  There is no need to prepare the file because the user will be prompted to 
  890. store all setup limits in a file (either default or user specified).  The pro-
  891. cedure to change the limits is similar to the "Data review and correction" rou-
  892. tine.
  893.  
  894. No other checking of legality or integrity of user entries is provided.  Wrong 
  895. data entered would probably result in the famous "Redo from start" error message 
  896. or "Division by zero" or "Overflow" or similar message, and the program could 
  897. abort.
  898.  
  899. After the limits are checked the user is prompted again.  Answer Y if the limits 
  900. are now correct.
  901.  
  902. The next prompt would be:
  903.  
  904.      "Save the data (N)?"
  905.  
  906. Which actually means to save the limits just entered.  The default answer here 
  907. is N, which means not to save the limits (into a file for later retrieval).
  908.  
  909. When the ENTER key is pressed (or any other key apart from Y) then the program 
  910. will continue with graphics on the graphics screen.
  911.  
  912. When the Y key (mind the case) is pressed the the user is prompted to supply a 
  913. filename where the limits data would be stored.  The user has now two choices; 
  914. either to type name (no check on legality or file existence) or just press the 
  915. ENTER key to use the default file (PLOT0?.SET - the question mark stands for 
  916. numerals 1 to 4 which are the actual plotting choices from the Main Menu).
  917.  
  918. The next step after this routine is the actual plot on the graphics screen.
  919.  
  920.  
  921. 3.3.4. Graphics Screen Plot.
  922.        ---------------------
  923.  
  924. The drawing on the graphics screen is optional, that means the user is prompted 
  925. before each drawing routine.  The first drawing routine is to draw the experi-
  926. mental points:
  927.  
  928.      "Draw points (Y)?"
  929.  
  930. The default answer is Y (or just press the ENTER key).  The experimental points 
  931. will be drawn on the graphics screen as small crosses.  When the user does not 
  932. wish the points to be drawn then the answer must be N (capital case).
  933.  
  934. The next one is the point connection routine.  Depending on the original plot-
  935. ting choice (from the Main Menu) there would be either curve or line drawn 
  936. through the points
  937.  
  938.      "Connect these points by line (Y)?"
  939.  
  940. The next one is the legend routine.  Note that only x axis legend is allowed and 
  941. it serves also as the title of the graph.
  942.  
  943.      "Legend (Y/N)?"
  944.  
  945.      (max. 80 chars.) TEST PLOT FOR "EXPERIMENTAL DATA POINTS"
  946.  
  947. Here we have three choices; type Y (mind the case) to enter the legend (in which 
  948. case the old legend, if any, will be written over), type N (again, mind the 
  949. case, in which case the old legend, if any, will be erased), and press ENTER (in 
  950. which case the old legend, if any, will be left unchanged).
  951.  
  952. The next routine will draw axis:
  953.  
  954.      "Draw axis (Y)?"
  955.  
  956. And the last routine will draw axis ticks and the x axis legend (which is also 
  957. the title of the graph):
  958.  
  959.      "Draw ticks and labels (Y)?"
  960.  
  961. Finally, the user will have a choice of repeating the graphics screen routines 
  962. or to exit and plot on graphics plotter:
  963.  
  964.      "Type R to repeat the routine, E to exit:"
  965.  
  966. This concludes screen graphics.  The following is related to plotter.
  967.  
  968.  
  969. 3.4. Graphics plotter routines.
  970.      --------------------------
  971.  
  972. The first prompt that appears is:
  973.  
  974.      "Continue with the plotter routines? (Y)"
  975.  
  976. Pressing N key (mind the case) will end the program; that means that all the 
  977. files created so far with the default filenames are left intact.  To continue 
  978. the program (to plot on the plotter) will require to type PLOT02 and the program 
  979. will resume with the plotter routines, or, if the user wishes to start again 
  980. with the graphics screen routines, then PLOT01 should be typed and the program 
  981. will do the screen graphics again.
  982.  
  983. Any other key will cause continuation of the program.  The next prompt will ask 
  984. for the type of the plotter:
  985.  
  986.      "Plotter is HP (Y/N)?"
  987.  
  988. The user has to press Y or N key to continue (again, mind the case) with the 
  989. program.  When HP is chosen then the baud rate is changed from 9600 (default) to 
  990. 2400 and the plotting area is changed to suit Hewlett-Packard plotter, where the 
  991. plotting area (in absolute plotter units) is 11420x8140, whereas for the other 
  992. choice, the FACIT plotter, the baud rate is 9600 and the area is 10880x7640 
  993. (plotting area: routine 6010, baud rate and communication port setup: subroutine 
  994. 1000, output to the port: subroutine 3200, all in PLOT02.BAS).
  995.  
  996. Now will follow routines for the setup of the chosen plotter.  Routines are in 
  997. similar order as in the graphics screen setup.  The first will prompt the user 
  998. to choose either which data set to use, or, if spline functions or regression 
  999. analysis was chosen in the Main Menu, then which function or which model to 
  1000. take.
  1001.  
  1002.      "There are 2 sets of data. Do data set no.:"
  1003.  
  1004. Make your choice and the following screen will appear:
  1005.  
  1006. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1007. <set limits>            Plot experimental points.          <data set no.: 1>
  1008. ============================================================================
  1009.  
  1010.  
  1011.  
  1012.  
  1013. Type K to use keyboard, D data-file for plotter set-up: D
  1014. \__________________________________________________________________________/
  1015.  
  1016. Here wee answer D (mind the case) because we have already saved the setup limits 
  1017. (in the default file PLOT01.SET).  We will be prompted for the filename, where 
  1018. simply by pressing the ENTER key the default file is read.  Otherwise the user 
  1019. has to supply his file.  No check on file existence or on the integrity of the 
  1020. file contents is done.
  1021.  
  1022. The next screen will display the limits of the plotting areas:
  1023.  
  1024. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1025. <set drawing area>    Plot experimental points.            <data set no.: 1>
  1026. =============================================================================
  1027.      All the text (incl. labels) is outside the drawing area indicated
  1028.      The total graphics area is 285.5 x 203.5mm
  1029.      Suggested plotting areas are as follows:
  1030.      ------------------------------------------------------
  1031.              |  x-axis (as on Hewlett-Packard)   | default
  1032.      margins | horizontal | vertical | vertical* |   set
  1033.      ------------------------------------------------------
  1034.      left        55.50       40.00      31.25      55.5
  1035.      right       40.00       55.50     134.375     40
  1036.      bottom      41.00       41.00      37.50      41
  1037.      top         20.00       20.00      40.625     20
  1038.  
  1039.                          default plotting area is 176.5  x 130
  1040.      note:
  1041.            all values in mm
  1042.            *) suitable for daisy-wheel printer (text) and plot together
  1043.  
  1044.           OK (Y/N)? Y
  1045. \__________________________________________________________________________/
  1046.  
  1047. The screen is self-explanatory and if some changes are needed the press the N 
  1048. key and change all that necessary.  The plotting area will be re-calculated and 
  1049. displayed again.  Pressing Y key will cause the display of the plotting limits:
  1050.  
  1051.  
  1052. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1053. <set limits>          Plot experimental points.            <data set no.: 1>
  1054. ============================================================================
  1055.  
  1056.      Axis intersect at X = 0
  1057.                        Y = 0
  1058.                   X(MIN) = 0
  1059.                   X(MAX) = 10
  1060.                   Y(MIN) = 0
  1061.                   Y(MAX) = 100
  1062.      --------------------------------------------------------------
  1063.         X-axis divisions = 10
  1064.         Y-axis divisions = 10
  1065.      --------------------------------------------------------------
  1066.                   F(MIN) = 0
  1067.                   F(MAX) = 0
  1068.      --------------------------------------------------------------
  1069.    X-axis tick (% above) = .5
  1070.                (% below) = .5
  1071.    Y-axis tick (% right) = .5
  1072.                 (% left) = .5
  1073.  
  1074.    OK (Y/N)?
  1075. \__________________________________________________________________________/
  1076.  
  1077. The lengths of the axis ticks are expressed here as percentage of the correspon-
  1078. ding axis span.  So to draw a grid, all that is necessary is to extend the axis 
  1079. tick to 100% above the x axis and 100 left of the y axis.  It does not really 
  1080. matter whether the graph is the "Portrait" or "Landscape".  The position of the 
  1081. x axis is viewed as being always horizontal, that is, when using the "Portrait" 
  1082. we turn the drawing paper the way that the x axis will be still horizontal but 
  1083. parallel with the shorter side of the drawing paper.  It should be noted that 
  1084. the ticks are drawn "twice", that is, the pen (when down) moves to the ticks up-
  1085. per position then to the lower position before returning to the axis (then up).  
  1086. It can be called "double strike" on a printer.  Does not really matter much be-
  1087. cause everything else can be drawn as many times as the user likes it.
  1088.  
  1089. The next screen is for axis labels:
  1090.  
  1091. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1092. <set labels>          Plot experimental points.            <data set no.: 1>
  1093. =============================================================================
  1094.  
  1095.         Multiplication factor, x-axis is 1 
  1096.                                y-axis is 1 
  1097.  
  1098.            x-axis is (horiz.=0, vert.=1) 0 
  1099.  
  1100. Label char. size width  (% of x-span) is .55 
  1101.                  height (% of y-span) is 1.15 
  1102.  
  1103. OK (Y)?
  1104. \__________________________________________________________________________/
  1105.  
  1106. The multiplication factors are valid only for labelling the axis and have no 
  1107. effect on the actual drawing of points and functions.  Thus, if the labels in 
  1108. the original user units would occupy too many character spaces to fit the divi-
  1109. sions on the axis, then the plot is drawn as it would be but the labels would be 
  1110. 10 times lower if the multiplication factor is .1, and so on.  The relation 
  1111. between the label value and the real value is:
  1112.  
  1113.      (label value) = (real value) * (multiplication factor)
  1114.  
  1115. Other people may take a different view.  The direction in which all the labels 
  1116. are drawn is the direction of the x axis.
  1117.  
  1118. The default "mode" is x axis horizontal (so called "landscape"), which means 
  1119. that x axis is parallel to the longer side of the drawing paper.
  1120.  
  1121. The default size of the characters approximately corresponds to PICA 10 on a 
  1122. printer.
  1123.  
  1124.  
  1125. The next screen sets up the legends:
  1126.  
  1127. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1128. <set legends>         Plot experimental points.            <data set no.: 1>
  1129. =============================================================================
  1130.  
  1131.                      Legend for x-axis is
  1132.  
  1133.  
  1134.                      Legend for y-axis is
  1135.  
  1136.  
  1137. Legend char. size width  (% of x-span) is .55 
  1138.                   height (% of y-span) is 1.15 
  1139.  
  1140.      OK (Y)?
  1141. \__________________________________________________________________________/
  1142.  
  1143. This routine may look somehow confusing.  The first display shows that there are 
  1144. no legends for the axis, which is all right because the legends were not entered 
  1145. yet.  By answering N (mind the case), the display will change to this:
  1146.  
  1147. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1148. <set legends>         Plot experimental points.            <data set no.: 1>
  1149. =============================================================================
  1150.  
  1151.                      Legend for x-axis is   [OK (Y)]?
  1152.  
  1153.  
  1154.                      Legend for y-axis is
  1155.  
  1156.  
  1157. Legend char. size width  (% of x-span) is .55 
  1158.                   height (% of y-span) is 1.15 
  1159.  
  1160.      OK (Y)? N
  1161. \__________________________________________________________________________/
  1162.  
  1163. The prompt has moved at the "Legend for x-axis is" prompt.  Now since there is 
  1164. still no x axis legend the user has to answer N (again, mind the case) to be 
  1165. prompted down the screen to type the x axis legend:
  1166.  
  1167. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1168. <set legends>         Plot experimental points.            <data set no.: 1>
  1169. =============================================================================
  1170.  
  1171.                      Legend for x-axis is   [OK (Y)]? N
  1172.  
  1173.  
  1174.                      Legend for y-axis is
  1175.  
  1176.  
  1177. Legend char. size width  (% of x-span) is .55 
  1178.                   height (% of y-span) is 1.15 
  1179.  
  1180.  ->
  1181. \__________________________________________________________________________/
  1182.  
  1183. The prompt is an arrow, "->", where the user has to type the x axis legend.  The 
  1184. limit is about 80 characters and will appear centered (with respect to the x 
  1185. axis length when drawn.  After the legend is typed (assuming the user has typed 
  1186. ABSCISSA) and the ENTER key is pressed the screen will change to this:
  1187.  
  1188. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1189. <set legends>         Plot experimental points.            <data set no.: 1>
  1190. =============================================================================
  1191.  
  1192.                      Legend for x-axis is   [OK (Y)]?
  1193. ABSCISSA
  1194.                      Legend for y-axis is
  1195.  
  1196.  
  1197. Legend char. size width  (% of x-span) is .55 
  1198.                   height (% of y-span) is 1.15 
  1199.  
  1200.  ->ABSCISSA
  1201. \__________________________________________________________________________/
  1202.  
  1203. And the user is prompted again whether the legend is all right.  To change the 
  1204. legend again the user has to press N and the routine will be repeated.  Pressing 
  1205. Y or ENTER key the prompt will shift after the prompt "Legend for y-axis is".  
  1206. The same procedure as for the x axis legend will follow.
  1207.  
  1208. The character size is approximately that of PICA 10 on a printer.  The legends 
  1209. are drawn parallel with their corresponding axis.
  1210.  
  1211. Before leaving this routine the screen will look similar to this:
  1212.  
  1213. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1214. <set legends>          Plot experimental points.           <data set no.: 1>
  1215. =============================================================================
  1216.  
  1217.                      Legend for x-axis is
  1218.  
  1219. ABSCISSA
  1220.  
  1221.                      Legend for y-axis is
  1222.  
  1223. ORDINATE
  1224.  
  1225. Legend char. size width  (% of x-span) is .55 
  1226.                   height (% of y-span) is 1.15 
  1227.  
  1228. OK (Y)? 
  1229. \__________________________________________________________________________/
  1230.  
  1231. Pressing N the routine will start all over again.
  1232.  
  1233. Typing Y or pressing ENTER key the routine for graph title will start:
  1234.  
  1235. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1236. <set title>           Plot experimental points.            <data set no.: 1>
  1237. =============================================================================
  1238.  
  1239. Title of the graph is
  1240.  
  1241.  
  1242.  
  1243.    Title char. size width  (% of x-span) is .55 
  1244.                     height (% of y-span) is 1.15 
  1245.  
  1246. Title justification is (left=0, centered=1) 0 
  1247.  
  1248. OK (Y)?
  1249. \__________________________________________________________________________/
  1250.  
  1251. The procedure for the title is the same as for the legends.  Here the user has 
  1252. option to have the graph title either centered or left justified (with respect 
  1253. to the x axis.
  1254.  
  1255. Assuming that the user typed "TEST PLOT" the final screen of this routine would 
  1256. look similar to this:
  1257.  
  1258. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1259. <set title>            Plot experimental points.           <data set no.: 1>
  1260. =============================================================================
  1261.  
  1262. Title of the graph is
  1263.  
  1264. TEST PLOT
  1265.  
  1266.    Title char. size width  (% of x-span) is .55 
  1267.                     height (% of y-span) is 1.15 
  1268.  
  1269. Title justification is (left=0, centered=1) 1 
  1270.  
  1271.      OK (Y)? 
  1272. \__________________________________________________________________________/
  1273.  
  1274.  
  1275. The next routine is to choose the symbol to be drawn for experimental points.  
  1276. The screen should look similar to this:
  1277.  
  1278. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1279. <error symbol set>       Plot experimental points.         <data set no.: 1>
  1280. ============================================================================
  1281.  
  1282.  
  1283. When drawing experimental points, include rel. error (N)? 
  1284.  
  1285.  Symbol for the points: X
  1286.  
  1287. Char. size, width  (% x-span):  .55
  1288. Char. size, height (% x-span):  1.15
  1289.  
  1290.  
  1291. OK (Y)? 
  1292. \__________________________________________________________________________/
  1293.  
  1294. The first question is whether to include relative errors when drawing the sym-
  1295. bol.  Default answer is N, but if the errors are to be included then the symbol 
  1296. for the experimental points will be a rectangle having the sizes of its sides 
  1297. doubles of the relative x and y errors.  There are two options of getting the 
  1298. experimental error values.  If there is an average relative error for x values 
  1299. and an average relative error for y values, then these two values have to be 
  1300. typed-in.  However, if each x and each y value has its error then these are in-
  1301. puted from a data file nominated by the user.  The structure of that file is the 
  1302. same as the experimental data file; random access, binary, record length is 4 
  1303. bytes storage (real numbers), max 640 records.
  1304.  
  1305. If the user chooses the default, N, then experimental errors are ignored and the 
  1306. user will be prompted to specify the symbol for the experimental points.  The 
  1307. symbol must be taken from plotter standard character set.  The geometric center 
  1308. of that symbol is the experimental point.
  1309.  
  1310. After making his selection the user is then prompted to specify the line type 
  1311. for the line or curve connecting the points or going through the set.
  1312.  
  1313. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1314. <line type set>          Plot experimental points.         <data set no.: 1>
  1315. ============================================================================
  1316.  
  1317.      Line types that can be used to plot functions:
  1318.           Solid line (type 0)
  1319.           Dotted line (type 1)
  1320.           Dashed line (type 2)
  1321.           Dotted/dashed line (type 3)
  1322.  
  1323.                Line type?
  1324. \__________________________________________________________________________/
  1325.  
  1326. The screen is self-explanatory.  When the user chooses the line type other than 
  1327. 0 then he will be prompted to specify the pattern length.
  1328.  
  1329. This is actually the last screen for the plotter setup and plotting enhance-
  1330. ments.  The next step is to choose to save the setup data into a file, repeat 
  1331. the setup routine, or to plot:
  1332.  
  1333.      "Type R to repeat the routine, S to save the setup data, P to plot:"
  1334.  
  1335. When the setup data are to be saved, then the user is prompted to specify the 
  1336. name of the file to hold the data.  If the ENTER key is pressed after the prompt 
  1337. then the default name, PLOT0?.SET (the question mark stands for numerals 1 to 4 
  1338. specifying the number of the plotting option selected at the Main Menu), is sup-
  1339. plied and the setup data are written into it.  If the user supplies the name no 
  1340. check for file existence or legality of the name is provided.  After the file is 
  1341. written to, the last prompt will appear again:
  1342.  
  1343.      "Type R to repeat the routine, S to save the setup data, P to plot:"
  1344.  
  1345. This time we will choose to plot.  The screen will look similar to this:
  1346.  
  1347. /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\
  1348. <program output>       Plot experimental points.           <data set no.: 1>
  1349. =============================================================================
  1350.  
  1351.  
  1352.  
  1353. Output to P)lotter or D)ata file? 
  1354.  
  1355. \__________________________________________________________________________/
  1356.  
  1357. The user is prompted to specify the direction of the output of this program.  
  1358. There is a choice to plot on the plotter or to store the command lines, which 
  1359. would be normally send to a plotter, in a data file.  The structure of the data 
  1360. file is sequential, ascii, delimited by CR/LF sequence, all in accordance with 
  1361. the Microsoft Basic sequential file format.
  1362.  
  1363. The following prompts will appear whether the output is directed to the plotter 
  1364. or not:
  1365.  
  1366.      "Change plotting paper, press ENTER when ready!"
  1367.  
  1368. If the output is directed to the plotter then after pressing the ENTER key, the 
  1369. serial port is initialized first before the command strings to setup the plotter 
  1370. to x-on/x-off handshake is send.
  1371.  
  1372. If the output goes to a file then no initialization of the serial port takes 
  1373. place.
  1374.  
  1375. Before each routine sends command lines to the plotter (or to the file) the user 
  1376. is prompted:
  1377.  
  1378.      "Draw axis (Y)?"
  1379.      "Label axis (Y)?"
  1380.      "Plot legend (Y)?"
  1381.      "Plot title (Y)?"
  1382.      "Plot points (Y)?"
  1383.      "Connect points by line (Y)?" or "Plot function (Y)?"
  1384.  
  1385. The default is to utilize that particular routine and to draw, but, if for any 
  1386. reason the user wishes to skip any of the routines, he has to press N (mind the 
  1387. case).
  1388.  
  1389. After the user presses ENTER, which means to go on with the plotting, he is 
  1390. prompted to make selection of the pen color.  The choices are those of the FACIT 
  1391. plotter and are, more or less, arbitrary.  If the user wishes he can change the 
  1392. thickness of the pen instead.  The following will appear on the screen:
  1393.  
  1394.      Color pens available on FACIT plotter are as follows:
  1395.           Black (type 1 or RETURN)
  1396.           Red (type 2)
  1397.           Green (type 3)
  1398.           Blue (type 4)
  1399.           Orange (type 5)
  1400.           Brown (type 6)
  1401.  
  1402.                Color no.:
  1403.  
  1404.  
  1405. When all is finished, the last screen will appear:
  1406.  
  1407.  
  1408.           - to repeat the same plot, type A,
  1409.  
  1410.           - to plot next set of data, type S,
  1411.  
  1412.           - to change the plotter, type P,
  1413.  
  1414.           - to enter new data, type D,
  1415.  
  1416.           - to exit this program, type X,
  1417.  
  1418.                Your choice?
  1419.  
  1420. The first option, repeat the same plot, will not appear when plotting into a 
  1421. data file.
  1422.  
  1423. If the A (mind the case) is chosen then the following prompt will appear:
  1424.  
  1425.           "Change plotting paper, press ENTER when ready!"
  1426.  
  1427. and, if different colors for pens were chosen, once or more times:
  1428.  
  1429.           "Change pen, then press ENTER to continue!"
  1430.  
  1431. before returning back to the last screen.
  1432.  
  1433.  
  1434. Selecting S will cause the program to got to the beginning of the setup menu 
  1435. where the selection of data sets or functions or regression models takes place.
  1436.  
  1437. Selecting P will cause the program to go to the very beginning of the plotter 
  1438. routines where the selection of the plotter (as well as the baud rate) takes 
  1439. place.
  1440.  
  1441. Selecting D will cause the program to to the very beginning of the whole pro-
  1442. gram, the Main Menu (PLOT.COM chaining).  The flag file, PLOT.FLG is cleared and 
  1443. PLOT.$$$ is set to all zeros.  All other files are left untouched, but will be 
  1444. written over whenever the program course will require.
  1445.  
  1446. Selecting X will cause the end of the program.  Control goes to the operating 
  1447. system.  All the files are left untouched for the user's disposal.
  1448.  
  1449.  
  1450. June 1991,
  1451.  
  1452.                                      Henry Brancik,
  1453.                                      henryb@usage.csd.unsw.oz.AU (UNIX machine)
  1454.                                      (Sch. Fiber Sci. Technl.,
  1455.                                      Univ. N. S. W., Australia)
  1456.