\documentstyle [12pt]{article}
\textwidth=6.0in
\textheight=8.5in
\topmargin=-0.25in
\oddsidemargin=0.5in
\renewcommand{\baselinestretch}{1.25}
\begin{document}

\begin{center}
\vspace*{1.0in}
{\huge\bf G R A F I T} \\
\vspace*{0.5in}
{\large\bf \underline{An Introduction}} \\
\vspace*{3.0in}
Author: \\
\vspace{0.15in}
{\large {\em Rong-Sheng Zhou}} \\
\vspace{0.35in}
{\large New York State College of Ceramics} \\
{\large Alfred University} \\
{\large Alfred, NY 14802} \\
January, 1989 \\
\end{center}

\newpage
\begin{center}
{\large\bf \underline{Overview of GRAFIT}} \\
\end{center}
\vspace*{0.25in}
Ever felt frustrated with doing simple 2-D graphics on your friendly 
and sophisticated VAX? If your answer is yes, here could be
the ideal 2-D plotting routine you ever need: {\bf GRAFIT}
--- a straightforward, friendly and yet sophisticated interactive 
2-D graphics package written in VAX FORTRAN-77 mainly for 
Tektronix-4100 and ReGIS color graphics terminals, and designed 
particularly for engineering scientists to run a VAX/VMS computer,
currently performs the following functions:
\vspace{0.15in}
\begin{tabbing}
12345678\=123456781234567890123456789\=12345678901234567890\=11 \kill
\>{\bf [1] X,Y Plot.}		\>{\bf [5] Pie-Chart Plot.} \\
\>{\bf [2] Layout Plot.}	\>{\bf [6] Text Plot.} \\
\>{\bf [3] Contour Plot.} 	\>{\bf [7] Function Plot.} \\
\>{\bf [4] Histogram Plot.}	\>{\bf [8] Digitization.} \\
\end{tabbing}
\vspace*{0.15in}
\begin{flushleft}
{\bf \underline{A list of Interactive Dialogue Features:}} \\
\end{flushleft}

\begin{itemize}
\item Menu and form driven, risk-free and die-hard, and {\em random-access} 
      oriented dialogue scheme, combined with DCL-like command inputs, allows 
      for fast and direct access of any single graph parameter and a group 
      of graph parameters.

\item {\em User-menu-free} oriented on-line help utility, of both concise and 
      comprehensive forms, are available anywhere along the dialogue session.

\item Default plot setups are provided throughout the program. Simply giving 
      the name of a valid data file is sufficient to initiate screen plotting.
      Further manipulation of plot setup and decoration of the graph are
      automatically recorded and saved so that the same plot can be started
      from where it was last left off.

\item {\em What-you-see-on-screen-is-what-you-get} oriented hardcopy making 
      utility can be invoked with a single command or keystroke, and the 
      intermediate plot files and DCL command procedures involved are 
      {\em transparent} to general users.
\end{itemize}

\newpage
\begin{flushleft}
{\bf \underline{A list of Graphics Features for X,Y Plot:}} \\
\end{flushleft}

\begin{itemize}
\item Allow for multiple data set and multiple data file input (plot overlay), 
      recognize multiple data formats including some binary formats.
      ASCII files are free of data field format. A valid data file 
      can be either editor-written or program-written.

\item Does automatic data scaling as well as user-specified data scaling
      for {\em linear}, {\em inverse linear}, and {\em log10} types of axis,
      while allowing for user-controll over such axis drawing parameters 
      as axis division, tickmark offset and direction, significant digits,
      etc...

\item Multiple x-axis and y-axis of same or different types and scalings,
      split axis on a single plot, and multi-plots per page, etc... are
      easily executable.

\item Error bar plot, multi-quadrant plot, non-orthogonal axis plot,
      area-fill plot, stick plot, bar plot are also implemented
      in addition to the usual line plus symbol plot.

\item Spline-smooth, least-square polynomial fit, data sorting,
      data column swap, multiple data set averaging and subtraction, 
      data filtering and differentiation are readily applicable.

\item Data point sampling, curve rescaling and offsets along both x and 
      y axis are allowed.

\item Utilization of a data independent plot setup file, which allows 
      not only for later duplication of the same plot but also for 
      plotting of batches of data with similar nature without redundent 
      manipulation of plot setup.

\item Auxiliary layout utility allows for plot labeling or annotation 
      anywhere and in any arbitrary orientation on the graph as well
      as for overlaying of a variety of 2-d geometric patterns such
      as line segment, curve, arrowhead, box, circle, polygon, etc..
      In other words, you can basically design and paint your graph
      in your own way.
\end{itemize}

\newpage
\begin{flushleft}
{\bf \underline{What is Layout Plot in GRAFIT?}} \\
\vspace*{0.15in}
\end{flushleft}
GRAFIT'S layout routine is basicaly a 2-D CAD. It allows for drawing
of precision layouts of publication quality such as flow-charts and schematic
diagrams without professional knowledge and training in CAD. It offers 
three main utilities by exploiting the segment graphics, GIN, and macro
capability of a Tektronix-4100 graphics terminal:
\begin{flushleft}
\hspace{0.5in} [1] Command format oriented layout in COMMAND mode.\\
\hspace{0.5in} [2] Graphics INput (GIN) oriented layout in GIN mode.\\
\hspace{0.5in} [3] Entry format oriented layout in ENTRY mode.\\
\vspace{0.15in}
You can do the following in layout COMMAND mode:\\
\end{flushleft}

\begin{itemize}
\item Manipulate layout files using layout commands like PLOT, OVERLAY, etc.

\item Set layout attributes such as layout scale, using layout command SET.

\item Enable ENTRY mode or GIN mode using layout command ENTRY or GIN
      to perform interactive layout other than from a layout file.

\item Transform existing layout using layout commands like MOVE, ROTATE, 
      ZOOM, COLOR, FILL, COPY, etc. in conjuction with definable function 
      keys and keypad.
\end{itemize}
\begin{flushleft}
A complete set of implemented layout commands is given below: \\
\end{flushleft}
\begin{tabbing}
123456\=123456789012345\=123456789012345\=123456789012345\=123456789012345\=11 \kill
\>CLEAR          \>CODE           \>COLOR          \>COPY \\
\>DELETE         \>ENTRY          \>EXIT,QUIT      \>FILL \\
\>GIN            \>HARDCOPY       \>HELP           \>OVERLAY,INCLUDE \\
\>MOVE           \>PICK,SELECT    \>PLOT           \>REFRESH \\
\>RELEASE        \>ROTATE         \>SAVE           \>SET \\
\>VISION         \>ZOOM           \>SPAWN,VAX,VMS \\
\end{tabbing}
\newpage
In layout GIN mode, you can manipulate the existing layout entries,
draw lines and curves, do text annotation etc., using GIN crosshair 
cursor in conjuction with defined function keys and keypad. \\\\
In layout ENTRY mode, you can draw new layout entries by specifying precise
and detailed entry parameters from keyboard input. Following basic types of 
layout entries or 2-D geometric patterns are pre-defined: {\em arc, circle, 
ellipse, pie, bar, box, oblique, polygon}, and a variety of {\em arrowheads}
and {\em icon symbols}. {\em Line, curve} and {\em text} layout are 
implemented only in GIN mode.\\\\
Again, {\em user-menu-free} oriented on-line help utility, of both concise 
and comprehensive forms, are available in the layout.

\begin{flushleft}
{\bf \underline{What is Function Plot in GRAFIT?}} \\
\end{flushleft}
GRAFIT'S function plot is actually a mathematical function digitization 
routine. It allows for generation of a single-variable curve or 
two-variable density plane from an arbitrary mathematic function in the 
form of $z=f(x,y)$, where $z$ represents a digitized array or grid of function 
values to be computed in a user specified $x,y$ space. The results are written 
to a data file ready to be plotted by the $x,y$ plot or contour plot routine 
depending upon the number of variables used in the math function. 
The function to be computed is typed in interactively from the keyboard 
in the formula of FORTRAN-77 conventions; a scratch FORTRAN file is then 
written by the program which in turn gets compiled, linked, and executed 
to produce the results. \\\\
To enhance efficiency of input and flexibility of computation, a number of 
user-specifiable constants and built-in mathematical and physical constants 
(e.g. $\pi$, Avogadro constant $N$, Planck constant $h$, speed of light $c$,
etc.) can also be embedded in the formula of input function.

\newpage
\begin{flushleft}
{\bf \underline{Auxiliary Command Procedure To Run GRAFIT:}} \\
\end{flushleft}
\vspace*{0.1in}
There are 3 ways you can invoke GRAFIT:
\begin{flushleft}
\hspace{0.5in} (1) \$ GRAFIT \\
\hspace{0.5in} (2) \$ GRAFIT data-file1 data-file2 ... data-file8/qualifiers \\
\hspace{0.5in} (3) \$ GRAFIT/qualifiers data-file1 data-file2 ... data-file8 \\
\vspace{0.1in}
Way (1) runs GRAFIT in normal interactive mode. \\
Way (2) or (3) runs GRAFIT in short-cut hardcopy making mode.\\
\vspace{0.15in}
\end{flushleft}
For short-cut hardcopy making mode, up to 8 data files, if desired,
can be enterd for an X,Y plot, 2 map files for a contour plot, 
and filenames are separated by a space or spaces (not by commas).
You can optionally specify the following positional qualifiers:

\begin{itemize}
\item /FUNCTION={\em keyword} \\
     Select the graphics function where valid keywords are:
     \begin{itemize}
     \item {\em XYPLOT} for X,Y plot [DEFAULT].
     \item {\em LAYOUT} for layout plot.
     \item {\em MAP} or {\em CONTOUR} for contour plot.
     \item {\em BAR} or {\em HISTOGRAM} for histogram plot.
     \item {\em PIE} for pie-chart plot.
     \item {\em TEXT} for text plot.
     \end{itemize}

\item /DEVICE={\em keyword} \\
     Select hardcopy making device where the valid keywords are:
     \begin{itemize}
     \item {\em HP7550} for a Hewlett-Packard HP7550-HPGL pen plotter [DEFAULT].
     \item {\em HP7221} for a Hewlett-Packard HP7221-seris pen plotter.
     \item {\em SLIDE} for a Presentation Technology 35mm Color SlideMaker.
     \item {\em LN03PS} for a LN03 postscript laser printer.
     \end{itemize}

\item /COPIES={\em number} \\
     Designate number of hardcopies where the valid range of {\em number}
     is from 1 through 99 [DEFAULT=1].

\item /SETUP={\em setup-file} \\
     Designate {\em setup-file} to be used where the {\em setup-file} overrides 
     the default plot setup.

\item /LAYOUT={\em layout-file} \\
     Designate auxiliary {\em layout-file} to be used where the {\em layout-file}
     overrides the default layout-file.
\end{itemize}
\vspace{0.15in}
All qualifiers can be entered with their own unique abbreviations and 
they are case-insensitive. When a qualifier is missing, its default value
is used. You can also define your own commands to incorporate the qualifiers.
\begin{flushleft}
Examples of command inputs:\\
\vspace{0.15in}
\$ GRAFIT JUNK.DAT\\
\$ GRAFIT JUNK.DAT JUNK1.DAT JUNK2.DAT\\
\$ GRAFIT JUNK.DAT/SETUP=BATCH.PAR/LAYOUT=BATCH.DES\\
\$ GRAFIT JUNK.DES/FUNCTION=LAYOUT/DEVICE=LN03PS/COPIES=5\\
\$ PSPLOT == ``GRAFIT/DEVICE=LN03PS/FUNCTION=XYPLOT''\\
\$ PSPLOT JUNK.DAT JUNK2.DAT\\
\$ HPPLOT == ``GRAFIT/DEVICE=HP7550/FUNCTION=XYPLOT''\\
\$ HPPLOT JUNK.DAT JUNK2.DAT\\
\end{flushleft}

\newpage
\begin{flushleft}
{\bf \underline{Acceptable Data File Formats For X,Y Plot:}} \\
\vspace{0.15in}
\end{flushleft}
Six commonly-used data formats are supported by X,Y PLOT. You can choose
any one of the six data formats when creating your data file and it will
be recognized automatically by X,Y PLOT's data acquisition routine.

\begin{verbatim}
(*) Valid Data Format #1 (FORMATTED/ASCII):
        1st line   :  NPTS       !SET ID LABEL
        2nd line on:  X, Y, YB
        ......
     NPTS is the number of data points or x,y pairs in the data set.
     YB is optional error bar value if error bar is to be plotted.
     From NPTS+2th line on, another set of data may follow.
     Example:
                3                            !1000C
                0.70   54.50000
                0.40   26.20000
                0.38   24.39744
                15                           !1500C
                0.32   15.34272   1.45
                0.30   13.20480   1.23
                ......

(*) Valid Data Format #2 (FORMATTED/ASCII):
        1st line on:  X, Y, YB, IT     !SET ID LABEL
        ......
     IT is a non-zero number entered to terminate a set of data
     IT is blank for all data lines except the last one in the set.
     After a non-zero IT, another set of data may follow.  
     IT can be omitted if there is only one set of data in the file.
     YB is the same as for data format #1.
     Example:
                100   10            !Anneal Sample
                300   36
                500   56
                700   90,, 1
                200   3.45          !Quench Sample
                400   5.87
                ......

(*) Valid Data Format #3 (FORMATTED/ASCII):
        1st line   : -NSET
        2nd line on:  X, Y(1), Y(2),..., Y(NSET)
        ......
        !SET ID LABEL FOR THE 1ST SET
        ......
        !SET ID LABEL FOR THE NTH SET
     Here NSET of data share the same X-coordinates
     and must have the same number of data points.
     Example:
                -5
                100  100  120  145  180  250.4
                200  80   97   116  140  265.5
                300  50   75   95   112  304.7
                ......
                !Anneal Sample
                !Quench Sample
                ......

(*) Valid Data Format #4 (FORMATTED/ASCII):
        1st line   :  X1, X2, X3, NPTS        !SET ID LABEL
        2nd line on:  Y(1), Y(2),..., Y(NPTS)
        .....
     NPTS is the number of Y-coordinates per line. X1 is the 
     beginning X-coordinate, X2 the ending, X3 the incremental.
     The number of data points is calculated as follows:
     	NUMBER-OF-DATA-POINTS = INTEGER((X2-X1)/X3+0.5)+1
     Example:
               1  100  1  5         !Anneal Sample
               1.05  0.98  2.34  3.45  4.20
               3.45  1.56  0.98  1.23  3.44
               ......
               502  1130  0.5  1    !Quench Sample
               20.5
               45.3
               ......

(*) Valid Data Format #5 (UNFORMATTED/BINARY):
        1st record:  X1, X2, X3        <--- 1st set of data
        2nd record:  (Y(I), I=1, NPTS)
        3rd record:  X1, X2, X3        <--- 2nd set of data
        4th record:  (Y(I), I=1, NPTS)
        ......
     X1,X2,X3 have the same definitions as in data format #4.
     NPTS is the number of data points calculated from X1,X2,X3.

(*) Valid Data Format #6 (UNFORMATTED/BINARY):
        1st record:  NPTS              <--- 1st set of data
        2nd record:  (X(I), I=1, NPTS)
        3rd record:  (Y(I), I=1, NPTS)
        4th record:  NPTS              <--- 2nd set of data
        5th record:  (X(I), I=1, NPTS)
        6th record:  (Y(I), I=1, NPTS)
        ......
     NPTS is th number of data points in the set.
\end{verbatim}

\newpage
\begin{flushleft}
{\bf \underline{TIPS for creating a data file:}}\\
\end{flushleft}
\begin{itemize}

\item A file can be in any one of the 6 data formats
   but you can not mix data formats in a file.

\item FORMATTED/ASCII files are free of data field formats with a max field
   length of 40 digits. Integers are acceptable data fields and can 
   be mixed with decimals anywhere in the file. Space or spaces as well as
   commas are valid field separators. TAB keys and blank lines are allowed.

\item Optional data set ID label (max=75 characters) must start with a ``!''
   at any column position after the numbers.

\item Following file extensions are searched for for a file without
   extension (in precedence from left to right): *.PLT, *.DAT, *.RAW.
\end{itemize}

\newpage
\begin{flushleft}
{\bf \underline{Acceptable Data File Format For Histogram:}} \\
\end{flushleft}

\begin{verbatim}
     Valid Data Format (FORMATTED/ASCII file only):
     	X(1)  Y(1,1)  Y(2,1)  Y(3,1)  Y(4,1)  ......
     	X(2)  Y(1,2)  Y(2,2)  Y(3,2)  Y(4,2)  ......
     	X(3)  Y(1,3)  Y(2,3)  Y(3,3)  Y(4,3)  ......
     	......
\end{verbatim}
where $X(I)$ is any alphanumerical label (max 8 characters allowed) for the
group of bars $Y(J,I)$ in the same line, also called the group label. $Y(J,I)$ 
is the bar height for data point $I$ of data set $J$ and can be positive or zero 
or negative. Max numbers of data sets (max index $J$) and data points (max index 
of $I$) can not exceed those allowed by the current version of program.

\begin{verbatim}
     Example of a valid data file:
     	100C 250    355.5 139.2 -220.6 65.7
     	200C 330.2  -35.5 239.2  -20.6 55.4
     	300C -460    55.5  19.2,     , 45.0
     	400C 180.54 -95.5 139.2 -100.6
     	500C 250.55 505.5,    ,      , 35.5
\end{verbatim}
In the example given above, 5 data points for each of 5 sets of bars are to
be plotted. Notice that a data file is free of data field formats with a max
field length of 40 digits per column. Integers are acceptable data fields and 
can be mixed with decimals anywhere in the file. Space or spaces as well as 
commas are valid field separators. TAB keys and blank lines are allowed.
Each input line is parsed during the input to get all the input columns.
Multiple sets or columns of bars, if any, do not have to have the same number
of data points. During plotting, blank or zero height bars are bypassed, and 
positive and negative bars, if co-existing, are plotted in the opposite 
directions with based line set at 0.0 coordinate on the y-axis. \\\\
Following file extensions are searched for for a file without extension 
(in precedence from left to right): *.BAR, *.DAT, *.RAW.

\newpage
\begin{flushleft}
{\bf \underline{Acceptable Data File Format For Contour Plot:}} \\
\end{flushleft}

\begin{verbatim}
Acceptable data format #1 for a map file (FORMATTED/ASCII):
      1st line: X1, X2, NC, Y1, Y2, NR
      2nd line: Z(1,1), Z(2,1), ...., Z(NC,1)
      3rd line: Z(1,2), Z(2,2), ...., Z(NC,2)
      ........  .......
     NRth line: Z(1,NR), Z(2,NR), ...., Z(NC,NR)
Acceptable data format #2 for a map file (UNFORMATTED/BINARY):
      1st record: X1, X2, NC, Y1, Y2, NR
      2nd record: ((Z(I,J), I=1,NC), J=1,NR)
\end{verbatim}
where $X1$ and $X2$ are beginning and ending $X$-coordinates, and $NC$ is 
number of grid points or equally-spaced columns in the map; $Y1$ and $Y2$ 
beginning and ending $Y$-coordinates, and $NR$ number of grid points or 
equaly-spaced rows in the map; $Z(I,J)$ the contour level at map point
$(X(I),Y(J))$.\\\\
Following file extensions are searched for for a file without extension 
(in precedence from left to right): *.MAP, *.DAT, *.RAW.

\newpage
\begin{center}
{\bf \underline{GRAFIT Installation Guide on VAX/VMS}}\\
\end{center}
\vspace{0.25in}
Before invoking GRAFIT.EXE, you need to do the following:

\begin{itemize}
\item Process GRAFIT.CLD to insert GRAFIT in the system DCL command table
    (SET COMMAND GRAFIT.CLD ...) so that GRAFIT can be run in addition
    in short-cut mode of hardcopy making. Enter GRAFIT HELP at system 
    command prompt to get the description of DCL GRAFIT after you have 
    finished the following steps (GRAFIT\_CLD.HLP in [GRAFIT.HELP\_DOC] 
    has the description).

\item Assign DISK:[GRAFIT]  to GRAF\$IT:\\
    ``GRAF\$IT:'' should point to where all the *.EXE files are stored.

\item Assign DISK:[GRAFIT.HELP\_DOC]  to GRAFIT\_HELP:\\
    ``GRAFIT\_HELP:'' should point to where all the *.HLP files are stored.

\item Define SUB\_PRINT as SUBMIT/QUE = PLOT\_BATCH\_QUE /NOPRINT /DELETE /NOLOG\\
    This {\em interactive-mode} command is needed for spawning the hardcopy.\\
    ``PLOT\_BATCH\_QUE'' should have ``job\_limit=1'' and ``base\_priority=4''.
\end{itemize}
Following commands are {\em batch-mode} commands and should be defined before \\
IF F\$MODE().NES.``INTERACTIVE'' THEN EXIT in login.com file. It could be 
a better idea to let individual user to define them to tailor their own needs:

\begin{itemize}
\item Define HP\_PRINT as PRINT/QUE=HP\_PRINTER\_QUE/DELETE \\
    This {\em batch-mode} command is needed to print the final hardcopy
    file on a HP pen plotter. ``HP\_PRINTER\_QUE'' is the printer queue
    dedicated to the HP plotter.

\item Define PS\_PRINT as PRINT/QUE=PS\_PRINTER\_QUE/DELETE \\
    This {\em batch-mode} command is needed to print the final hardcopy
    file on a POSTSCRIPT laser printer. ``PS\_PRINTER\_QUE'' is the
    printer queue dedicated to the POSTSCRIPT laser printer.

\item Define IM\_PRINT as PRINT/QUE=IM\_PRINTER\_QUE/DELETE \\
    This {\em batch-mode} command is needed to print the final 
    hardcopy file on a Presentation Technology 35mm Color Image/Slide-Maker.
    ``IM\_PRINTER\_QUE'' is the printer queue dedicated to the Image-Maker.
\end{itemize}

\begin{flushleft}
An example of all needed assignments and definitions is given bolow:\\
\vspace{0.1in}
\$ ASS CRYST:[ZHOU.GRAFIT]           GRAF\$IT:\\
\$ ASS CRYST:[ZHOU.GRAFIT.HELP\_DOC]  GRAFIT\_HELP:\\
\$ SET COMMAND CRYST:[ZHOU.GRAFIT]GRAFIT.CLD\\
\$ SUB\_PRINT ==``SUBMIT/QUE=SYS\$PLOT/NOPRINT/NOLOG/DELETE''\\
\$  HP\_PRINT ==``PRINT/QUE=HP\$PRINT/DELETE''\\
\$  PS\_PRINT ==``PRINT/QUE=PS\$PRINT/DELETE''\\
\$  IM\_PRINT ==``PRINT/QUE=IM\$PRINT/DELETE''\\
\$ SET TERM/NOWRAP/DEV=VT100/INSERT/NOESCAPE\\
\vspace{1.0in}
Have fun!!!\\
\vspace{0.25in}
\hspace{3.5in} Rong-Sheng Zhou \\
\hspace{3.5in} 212 Devlin \\
\hspace{3.5in} Chemistry Dept. \\
\hspace{3.5in} Boston College \\
\hspace{3.5in} Tel: 617-552-3905\\
\end{flushleft}

\end{document}
