home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / ABCPLOT.ZIP / ABCPLOT.DOC next >
Text File  |  1991-04-02  |  16KB  |  297 lines

  1.     Command:    abcplot
  2.                              
  3.     Usage:      abcplot {datafile} [options]
  4.  
  5.     Description:
  6.     ABCPLOT is a simple graphing utility that quickly plots 
  7.     scatterplots of data.  Data can originate in a file or in
  8.     standard input.  ABCPLOT gets all its information (except the
  9.     data to be graphed) from the command line.  Results are
  10.     printed to standard output (optionally to a specified file).
  11.     The plot is by no means high-quality, but it is very fast and 
  12.     can be an easy way to scan a dataset for relationships 
  13.     among variables.
  14.  
  15.     ABCPLOT plots a dataset using characters such as A,B,C.  The 
  16.     plot is an XY-graph, where the plotting symbols represent a data 
  17.     record's location in an X-Y coordinate system. Up to 10 dependent 
  18.     variables (y-variables) can be plotted, and are represented by 
  19.     different plotting symbols (A through J).  Only one independent 
  20.     variable (x-variable) can be specified.
  21.                                                                            
  22.     If the command line indicates a categorical variable, ABCPLOT
  23.     will represent the category by the plotting symbol.  A categorical
  24.     variable cannot also be used as an x- or y-variable, and must 
  25.     have 10 or fewer unique values.  Additionally, each value of the 
  26.     x-variable must be repeated for each category.  Categorical variables 
  27.     are valid only if a single y-variable is specified.                                 
  28.  
  29.     Arguments:
  30.       datafile  - ASCII file with data to be graphed.  The file must 
  31.                   have at least 2 lines.  Aside from header-comment
  32.                   lines (more on those later), the file must contain
  33.                   only numbers that are readable by FORTRAN in list
  34.                   format (i.e., delimited by commas or spaces); 
  35.                   each line of the file must contain the same
  36.                   number of fields (but lines don't have to be the
  37.                   same length).  Currently, file size is 
  38.                   limited to 3000 lines and 100 variables.
  39.  
  40.                   If datafile is not specified, data are assumed
  41.                   to be present on standard input, and ABCPLOT will
  42.                   wait for an end-of-file mark before processing
  43.                   the data stream.  The same restrictions on file 
  44.                   size apply to the size of the data stream.
  45.  
  46.                   The file can contain header-comment lines which 
  47.                   document the data file.  These lines must have
  48.                   a special character ( one of !#"* ) in the first
  49.                   position of the line.  Any number of header-comment
  50.                   lines is allowed, as long as they precede the data.
  51.                   Header-comment lines are disregarded by the
  52.                   plotting routines and have no effect on the plot.
  53.             
  54.  
  55.     Options:
  56.  
  57.         If no options are specified, the defaults are : -x 1 -y 2
  58.         Options are case insensitive.
  59.  
  60.         -x n          - Specify column n as independent variable.
  61.                         If -x 0 is used, the sequence number of the 
  62.                         data record is used as the x-variable.
  63.  
  64.         -y n1 {..n10} - Specify column(s) ni's as dependent variable(s)
  65.                         (up to 10).
  66.  
  67.         -o {outfile}  - If specified, the plot will be written to a file.
  68.                         This plot will have more resolution (132 characters
  69.                         across) than the plot that is written to standard 
  70.                         output (78 characters across).  To print this file,
  71.                         either wide paper or a small point size should be
  72.                         used.
  73.  
  74.         -c n          - specify a column containing category variable with
  75.                         up to 10 unique values.  If a categorical variable is
  76.                         identified, ABCPLOT will represent the category by the 
  77.                         plotting symbol.  A categorical variable must not be
  78.                         used as an x- or y-variable; it must have 10 or fewer
  79.                         unique values; additionally, each value of the x-
  80.                         variable must be repeated for each category.  
  81.                         Categorical variables are not recognized if more than 
  82.                         one y-variable is specified.
  83.  
  84.         -s              Switches X and Y axes.  This is useful when you have 
  85.                         several dependent variables to be graphed in the 
  86.                         horizontal dimension.
  87.  
  88.         -n              Produces numerical output instead of a plot.  This
  89.                         is useful when a categorical variable has been used, 
  90.                         and you want to organize the data so each field of the
  91.                         new dataset contains the value of the y-variable for a
  92.                         value of the category variable.  This may make it 
  93.                         easier to send the data to other applications such as
  94.                         Cricket Graph or a spreadsheet.  This option can also
  95.                         be useful when the accuracy of the plot is in 
  96.                         question.  See example 4.
  97.  
  98.                         The -n option allows ABCPLOT to perform the work of my
  99.                         related utility, FOLDIT.  FOLDIT is now obsolete.
  100.  
  101.     Examples:
  102. 1.  If the file 'data1' contains the lines:
  103.     10 1.5 1.8
  104.     15 1.8 1.4
  105.     20 2.3 1.2
  106.     5  1.1  2
  107.     4  1    1.5
  108.     
  109.     -- Then the command,
  110.     abcplot data1 -x 1 -y 2 3        -- produces ...
  111.            +---------------+---------------+---------------+---------------+ 
  112. 0.230E+01 +                                                                A+
  113. 0.222E+01 +                                                                 +
  114. 0.215E+01 +                                                                 +
  115. 0.207E+01 +                                                                 +
  116. 0.199E+01 +    B                                                            +
  117. 0.192E+01 +                                                                 +
  118. 0.184E+01 +                                                                 +
  119. 0.176E+01 +                        B                   A                    +
  120. 0.169E+01 +                                                                 +
  121. 0.161E+01 +                                                                 +
  122. 0.154E+01 +B                       A                                        +
  123. 0.146E+01 +                                                                 +
  124. 0.138E+01 +                                            B                    +
  125. 0.131E+01 +                                                                 +
  126. 0.123E+01 +                                                                B+
  127. 0.115E+01 +                                                                 +
  128. 0.108E+01 +    A                                                            +
  129. 0.100E+01 +A                                                                +
  130.            +---------------+---------------+---------------+---------------+ 
  131.      0.400E+01       0.800E+01       0.120E+02       0.160E+02       0.200E+02
  132.  
  133. 2.  If the file 'mydata' contains the lines:
  134.     0 1 1
  135.     0 2 3
  136.     5 1 1.5
  137.     5 2 3.2
  138.     10 1 1.8
  139.     10 2 3.5
  140.     15 1 2
  141.     15 2 3.6
  142.     20 1 2.5
  143.     20 2 3.8
  144.     25 1 2.5
  145.     25 2 3.2
  146.     30 1 2
  147.     30 2 2.8
  148.     35 1 1.5
  149.     35 2 2
  150.     40 1 1.4
  151.     40 2 1.8
  152.     45 1 1.3
  153.     45 2 1.3
  154.     50 1  1.1
  155.     50 2 1.01 
  156.  
  157.     -- Then the command,
  158.     abcplot mydata -y 3              -- produces...  
  159.            +---------------+---------------+---------------+---------------+
  160. 0.380E+01 +                          A                                      +
  161. 0.364E+01 +                   A                                             +
  162. 0.347E+01 +             A                                                   +
  163. 0.331E+01 +                                                                 +
  164. 0.314E+01 +      A                         A                                +
  165. 0.298E+01 +A                                                                +
  166. 0.281E+01 +                                      A                          +
  167. 0.265E+01 +                                                                 +
  168. 0.248E+01 +                          A     A                                +
  169. 0.232E+01 +                                                                 +
  170. 0.215E+01 +                                                                 +
  171. 0.199E+01 +                   A                  A      A                   +
  172. 0.182E+01 +             A                                     A             +
  173. 0.166E+01 +                                                                 +
  174. 0.149E+01 +      A                                      A                   +
  175. 0.133E+01 +                                                   A      *      +
  176. 0.116E+01 +                                                                A+
  177. 0.100E+01 +A                                                               A+
  178.            +---------------+---------------+---------------+---------------+
  179.      0.000E+00       0.125E+02       0.250E+02       0.375E+02       0.500E+02
  180.  
  181.     -- The * symbol indicates that more than one point occurs at that
  182.     -- position.
  183.  
  184. 3.  However, the command,
  185.     abcplot mydata -y 3 -c 2       -- produces...
  186.            +---------------+---------------+---------------+---------------+
  187. 0.380E+01 +                          B                                      +
  188. 0.364E+01 +                   B                                             +
  189. 0.347E+01 +             B                                                   +
  190. 0.331E+01 +                                                                 +
  191. 0.314E+01 +      B                         B                                +
  192. 0.298E+01 +B                                                                +
  193. 0.281E+01 +                                      B                          +
  194. 0.265E+01 +                                                                 +
  195. 0.248E+01 +                          A     A                                +
  196. 0.232E+01 +                                                                 +
  197. 0.215E+01 +                                                                 +
  198. 0.199E+01 +                   A                  A      B                   +
  199. 0.182E+01 +             A                                     B             +
  200. 0.166E+01 +                                                                 +
  201. 0.149E+01 +      A                                      A                   +
  202. 0.133E+01 +                                                   A      *      +
  203. 0.116E+01 +                                                                A+
  204. 0.100E+01 +A                                                               B+
  205.            +---------------+---------------+---------------+---------------+
  206.      0.000E+00       0.125E+02       0.250E+02       0.375E+02       0.500E+02
  207.  
  208. 4.  And the command,
  209.     abcplot mydata -y 3 -c 2 -n      -- produces...
  210.     0.000000E+00        1.000000        3.000000
  211.         5.000000        1.500000        3.200000
  212.        10.000000        1.800000        3.500000
  213.        15.000000        2.000000        3.600000
  214.        20.000000        2.500000        3.800000
  215.        25.000000        2.500000        3.200000
  216.        30.000000        2.000000        2.800000
  217.        35.000000        1.500000        2.000000
  218.        40.000000        1.400000        1.800000
  219.        45.000000        1.300000        1.300000
  220.        50.000000        1.100000        1.010000
  221.  
  222.     -- Note that the above numeric output places each unique X-value in the 
  223.        first field; the second field contains the value of the Y-variable 
  224.        where the categorical variable takes its first unique value
  225.        (i.e., 1 in this dataset); the third field contains the value of the
  226.        Y-variable where the categorical variable takes its second
  227.        unique value (i.e., 2 in this dataset).
  228.  
  229.     -- Beside plotting data from a file, ABCPLOT will also accept data from
  230.     -- standard input.
  231.  
  232. 5.  If we have a FORTRAN program which generates data to standard output
  233.     as follows,
  234.       -- PROGRAM GENDAT
  235.       -- DO T=1.0,20.0,0.1
  236.       --    PRINT *,T,SIN(T),COS(T),SIN(T)+COS(T)
  237.       -- END DO
  238.       -- END
  239.  
  240.     -- After compiling and linking (assume the executable file for 
  241.        the program is 'gendat.exe'), we can use the command:
  242.  
  243.     gendat | abcplot -x 1 -y 2     
  244.     -- which produces...
  245.            +---------------+---------------+---------------+---------------+
  246. 0.100E+01 + ***                  A**                  A**                   +
  247. 0.882E+00 +*A AA                A* A*                 *  *                 A+
  248. 0.764E+00 +    *                *   AA               *    *               AA+
  249. 0.647E+00 +     *              A     A              AA    A               * +
  250. 0.529E+00 +     A              *     AA             A      *             A  +
  251. 0.411E+00 +      A            A       A             A      A             A  +
  252. 0.294E+00 +      *            A       A            A        A           AA  +
  253. 0.176E+00 +       A           A        *           *        A           A   +
  254. 0.586E-01 +       A          *         A          A         AA          A   +
  255. -.590E-01 +       A          A          A         A          A         A    +
  256. -.177E+00 +        A        A           A         A          A         A    +
  257. -.294E+00 +        *        A           A        A            A       AA    +
  258. -.412E+00 +         A      AA            *       *            A       A     +
  259. -.530E+00 +         A      A             A      A             AA      A     +
  260. -.647E+00 +         AA    AA              *     *              A     *      +
  261. -.765E+00 +          *    A               A    *               AA   AA      +
  262. -.882E+00 +           *  *A                *A AA                A*  *       +
  263. -.100E+01 +            **A                  ***                  A**        +
  264.            +---------------+---------------+---------------+---------------+
  265.      0.100E+01       0.573E+01       0.105E+02       0.152E+02       0.199E+02
  266.         
  267.  
  268. Related Utilities:
  269.  
  270. MKTAB --  (Available from me).  Replaces blanks separating fields in a data 
  271.           file with tabs.  Useful for importing data into applications such 
  272.           as Cricket Graph or Excel.
  273.  
  274. DTAB  --  (Available from me).  The opposite of MKTAB, it replaces tabs with 
  275.           blanks.  Designed to clean up FORTRAN code, but it works fine with 
  276.           data files.
  277.  
  278. AWK    -- (Available from various sources).  A ubiquitous utility,
  279.           originally found on UNIX systems, which processes data files.
  280.           Can be used to filter data prior to plotting.
  281.  
  282. GNUPLOT-- (Available from various sources).  Produces graphic plots which 
  283.           are prettier and more verstatile than ABCPLOT's.  But it requires 
  284.           that the input file have only one dependent variable, so it cannot 
  285.           use multiple Y-variables or categorical variables.  Multiple-field 
  286.           datasets have to be artfully processed with AWK and/or other 
  287.           utilities before GNUPLOT can graph them.  This is usually not 
  288.           necessary with ABCPLOT.  Also, ABCPLOT's output, being text, can be 
  289.           printed on any printer or written to any ASCII file.
  290.  
  291. CONV77 -- (Available from me).  Scans a FORTRAN source file and replaces the 
  292.           non-standard DO ... END DO constructs, with numbered DO n ... 
  293.           n CONTINUE constructs.
  294.  
  295. ABCPLOT was written by Bob Dougherty.  Command-line parser by Ryan Rumanang.
  296. Standard input enhancement by Rudy Ting Liang.
  297.