DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T g

⟦44691369e⟧ TextFile

    Length: 55427 (0xd883)
    Types: TextFile
    Names: »gnutex.tex«

Derivation

└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z« 
        └─⟦036c765ac⟧ 
            └─⟦this⟧ »TeX3.0/TeXcontrib/gnutex/doc/manual/gnutex.tex« 

TextFile

% 
% Manual for gnutex plotting program
% David Kotz (dfk@cs.duke.edu)
% Duke University Computer Science Department

% some header info
\input{header}

\begin{document}

\title{The Gnu\TeX\ Plotting 
Program\thanks{This document describes Gnu\TeX\ version 1.6, based on
gnuplot version 1.0.3. All plots in this document were made with that
version of Gnu\TeX.} }
\author{David Kotz \\ \verb+dfk@cs.duke.edu+}
\date{March 13, 1989}

\maketitle

\pagestyle{headings}

\tableofcontents
\newpage

\pagestyle{myheadings}
\markright{Gnu\TeX\ Manual Version 1.6}

\currentspace % defined in header.tex

\section{Introduction and History}

Gnu\TeX\ is an extended version of the program {\tt gnuplot},
developed by Colin Kelley and Thomas Williams in 1986 to plot
functions and data files on a variety of terminals. (It is {\sc not} a
GNU version of \TeX!). My modifications have mostly to do with a new
``terminal type'' called {\tt latex}, so gnuplot will output \LaTeX\
code. The plot may then be included in a \LaTeX\ document. I added a
number of embellishments, supported only by the {\tt latex} terminal,
allowing the user to produce publication-quality plots.

This manual is organized as follows: first, I briefly describe the
intent and capabilities of Gnu\TeX.  Second, a tutorial introduction
to Gnu\TeX\ presents a few examples of its use, and is enough to get
started with your first plots. Following that is a more detailed
description of all of the commands in Gnu\TeX.

\section{Capabilities}

Gnu\TeX\ has the plotting capabilities of {\tt gnuplot}, and thus may
plot a variety of functions and expressions as well as data files.
Users may define their own functions and variables, and plot functions
or data over a specified range, with optional log scales. Several
curves may be plotted on the same plot. Each curve may have a
different style, helping to differentiate between them. Auto-scaling
of the $y$ axis is possible, and all tic marks on the axes are
automatically determined. In {\tt gnuplot}, only crude labels are
supported.

Gnu\TeX\ supports the following terminals: Aed767, HP7580 (and
probably other HPs), QMS/QUIC laserprinter (Talaris 1200 and others),
ReGis graphics (VT220, VT240, Gigis, \etc), Tektronix 4010 (and
probably others), Tektronix 4010 (top/bottom half of screen), PC (for
CGA and EGA), Imagen printers, unixplot, and FIG and \LaTeX\ output.

The extensions I made provide the \LaTeX\ output, as well as axes and
title labels, tic mark labels, user-defined linestyles, two new
predefined linestyles, arbitrary labels on the plot, an optional key,
and comments and line continuation in the input file.

Gnuplot and Gnu\TeX\ should run on many flavors of Unix, on VMS,
and, apparently, under MS-DOS. This document will follow the Unix
implementation, where it matters (\eg, how to run {\tt gnutex}).

The reader should note that the \LaTeX\ picture environments output by
Gnu\TeX\ can be quite large and complicated, and can easily exceed the
memory capacity of \TeX. If an enlarged version of \TeX\ is available,
it is wise to use it. Otherwise, keep your plots simple and add
\verb+\clearpage+ to your document where necessary.

\section{Tutorial}

\subsection{Using Gnu\TeX\ Interactively}
Gnu\TeX\ is by nature an interactive program. Users intending to make
plots for \LaTeX\ will generally not use Gnu\TeX\ interactively. Those
users may skip to the next section (Section~\ref{secnonint}).  Thus,
to get started, simply run {\tt gnutex}, and it will respond with a
prompt.  If you wish to see your plots, you need to run it on a
terminal supported by Gnu\TeX\ (or an emulator, such as {\tt tektool}
on a Sun workstation). To set your terminal type, enter
\begin{quote} 
\tt
    set terminal {\em type}
\end{quote}
where {\em type} is precisely one of the following: {\tt cga}, {\tt
ega}, {\tt corona}, {\tt aed767}, {\tt hp75xx}, {\tt qms}, {\tt
regis}, {\tt tek40xx}, {\tt toptek}, {\tt bottek}, {\tt unixplot},
{\tt imagen}, {\tt fig}, or {\tt latex}.  If it doesn't accept your
input, then probably Gnu\TeX\ was not compiled to support that
terminal. Type {\tt set terminal} alone to see what terminals are
supported. Ask your Gnu\TeX\ maintainer to recompile with support for
that terminal.

Once the terminal type is set, you may plot functions and data
interactively to the screen, using the commands below.  Note that the
{\tt latex}, {\tt fig}, {\tt qms}, and {\tt imagen} terminal types are
not intended for interactive use; see the next section.

\subsection{Using Gnu\TeX\ for Hard Copy}
\label{secnonint}

Whenever hard copy is desired from Gnu\TeX, the program need not be
run on a graphics terminal. In this case the output is directed to a
file or pipe, then sent to the appropriate output device. For example,
output from the terminal type {\tt unixplot} may be sent to a program
interpreting the Unix plotting standard. The terminal types {\tt qms},
{\tt imagen}, and {\tt tek40xx} may be used for output to printers
understanding those languages (Imagen printers have a Tektronix
emulation mode.)  The terminal type {\tt fig} outputs FIG code that
can be read by the Fig graphics program and translated into forms
usable in both \TeX\ and \LaTeX\ documents.  A shell script ({\tt
lasergnu}) is supplied with the distribution that will accept a
Gnu\TeX\ command or input file and send the output to an Imagen laser
printer. The person who installs Gnu\TeX\ may have adapted this script
to your site.

Thus, we may now ignore the interactive nature of gnutex, and provide
the input to Gnu\TeX\ from a file, \ie,
\begin{verbatim}
      gnutex < gnu.input
\end{verbatim}
In this example, all of the commands to Gnu\TeX\ are contained in the
file {\tt gnu.input}. The output (one or more plots) may be piped to
another program or redirected to a file. Usually, however, we direct
the output explicitly with an instruction to Gnu\TeX\ (see the {\tt
set output} command). When redirecting the standard input, Gnu\TeX\
continues to print its prompts and error messages to the terminal.

\subsection{Using Gnu\TeX\ for \LaTeX}

Although hardcopy can be obtained in many ways, as described above, I
will describe the use of Gnu\TeX\ to produce \LaTeX-compatible output
as this is likely to be what users want to know first. Be aware that
many of the features described below are available in this mode only.
This is due to the capabilities of \LaTeX\ and my own personal
interest in adding capabilities easily supported by
\LaTeX.

\paragraph{Example 1:} Here is a first example, producing a plot for
this document. The Gnu\TeX\ input file is given below, and the output
appears as Figure~\ref{eg1}. The input file defines the output to be
in \LaTeX, gives a file name for the output, and plots $y=sin(x)$ for
$x$ on $[-\pi,\pi]$. To produce the figure, I simply
\verb+\input{eg1}+ in a {\tt center} environment in a {\tt figure}
environment. In following examples, I will enclose the figure in a box
to make it look a little better.
\singlespace
\begin{verbatim}
    set terminal latex
    set output "eg1.tex"
    plot [-3.14:3.14] sin(x)
\end{verbatim}
\currentspace

\begin{figure}[htbp]
  \begin{center}
    \input{eg1}
  \end{center}
  \caption{A first example: $y=sin(x)$} 
  \label{eg1}
\end{figure}

Note that Gnu\TeX\ has drawn in the axes, labeled the tic marks for
us, and scaled the $y$ axis automatically. The labeling is only done
for the {\tt latex} and {\tt imagen} output modes, not for any of the
other supported terminals.

You may note, however, that the curve is drawn with many dots, instead
of lines. This is due to the inadequate picture-drawing capabilities
of \LaTeX.\footnote{EEPIC users: look for improvements to be released
in the future.} The way the curve is drawn may be changed by the user
(Section~\ref{set-style}).

\paragraph{Example 2:} Now we will embellish the plot a little with
some labels.  This input file produces Figure~\ref{eg2}.

\singlespace
\begin{verbatim}
    set terminal latex
    set output "eg1.tex"
    set size 5,4
    set title "This is a plot of $y=sin(x)$"
    set xlabel "This is the $x$ axis"
    set ylabel "This is\\the\\$y$ axis" 1
    plot [0:6.28] [0:1] sin(x)
\end{verbatim}
\currentspace

\boxfigure{htbp}{\fullboxwidth}{
  \begin{center}
    \input{eg2}
  \end{center}
  \caption{A more fancy example.}
  \label{eg2}
}

Here we have defined the range of both $x$ (now $[0,2\pi]$) and $y$
(here $[0,1]$). We have also specified the plot to be 5 inches wide
and 4 inches tall with the {\tt set size} command. This is the size of
the box that Gnu\TeX\ draws. In the first example, this size was the
default 4 inches by 3 inches. A title for the plot and labels for the
axes were set up in the next three commands. Note that they are
processed by \LaTeX\ and so may have math mode and other symbols in
them. All three may have multiple lines, delineated with \verb+\\+.
Once these are set up, they will be used for all subsequent plot
commands until they are changed. These labels are also supported by
the {\tt Imagen} terminal type, but (of course) any \LaTeX\ code in
the string will not be interpreted.

There is an optional extra argument in the {\tt set ylabel} command,
and here its value is {\tt 1}. This value, an integer, specifies an
amount to move the $y$ label to the left. Depending on the nature of
the values on the $y$-axis, the $y$ label may tend to run into the tic
mark labels. This extra parameter allows you to adjust the position of
the label.

So far we have plotted one curve, $y=\sin(x)$, on one plot. In
Gnu\TeX, each {\tt plot} command generates a new plot. If the output
is to a screen, the screen is cleared. If to a printer, a new page is
produced. In the {\tt latex} case, a new picture is started. It is not
likely that \LaTeX\ users will want this to happen, so generally each
plot has its own input file and is kept in a separate output ({\tt
.tex}) file for inclusion at different places in the document.

\paragraph{Example 3:} To place more than one curve on a plot, use one
{\tt plot} statement and separate the description of each curve by a
comma. In our next example, we will plot both a function and a data
file on the same plot. This plot is shown in Figure~\ref{eg3}.

\singlespace
\begin{verbatim}
    set terminal latex
    set output "eg3.tex"
    set title "This is another plot"
    set xlabel "$x$ axis"
    set ylabel "$y$ axis" 1
    plot x with lines, "eg3.dat" with linespoints
\end{verbatim}
\currentspace

\boxfigure{htbp}{\fullboxwidth}{
  \begin{center}
    \input{eg3}
  \end{center}
  \caption{An example with two curves on the same plot.}
  \label{eg3}
}

Here you will see that the $x$ range was not specified. The default
$x$ range is $[-10,10]$, which was sufficient for this example. The
function $y=x$ was plotted with a {\em linestyle} called {\tt lines},
which is the default, and was explicitly specified here only to
exhibit the syntax. The data file {\tt eg3.dat} was plotted with style
{\tt linespoints}, a style like {\tt lines} that also plots a symbol
at each data point. There is a style called {\tt points} that only
plots the symbols are data points, and another called {\tt dots} that
plots a tiny dot for each data point (though this is not really
intended for use with \LaTeX).  The {\tt points} and {\tt linespoints}
styles produce a different symbol for each curve on the plot (for up
to six symbols, after which they are re-used).  Finally, the style
{\tt impulses} draws a perpendicular from each point to the $x$-axis.

\paragraph{Going further:} You should now be able to make a variety of
plots for your \LaTeX\ document. We will present a final example
without explanation that showcases some of the capabilities of
Gnu\TeX. You may find documentation for the various commands in the
next section, though hopefully this example is somewhat
self-explanatory.

\singlespace
\begin{verbatim}
    set terminal latex
    set output "eg4.tex"
    set size 3.5,3
    set format x "$%5.1f\mu$"
    set noclip
    set title "This is a very long title\\because it has\\three lines"
    set xlabel "This is the $x$ axis\\with more than two\\lines in the label"
    set ylabel "This is a longer\\version of\\the $y$ axis"
    set style new1 "$\otimes$" 3 "\circle*{100}" "\circle*{200}" "\circle*{300}"
    plot [-10:10] [-10:10] "eg3.dat" with new1, 3*exp(-x*x)+1 with lines
    label -5,-5 "Data" rb 1.7
    key -7,5 "Data file" with new1, "$3e^{-x^{2}}+1$" with lines
\end{verbatim}
\currentspace

\boxfigure{htbp}{\fullboxwidth}{
  \begin{center}
    \input{eg4}
  \end{center}
  \caption{An example of many features.}
  \label{eg4}
}

\subsection{Summary --- Use with \LaTeX}
In summary, to use the \LaTeX\ facilities of Gnu\TeX, the first
command to Gnu\TeX\ should be
\begin{syntax}
    set terminal latex
\end{syntax}
and the output of latex should be directed to a file, for example,
\begin{verbatim}
    set output "plot.tex"
\end{verbatim}
This may be anything you like but it should have a {\tt .tex} extension,
of course. Then the size of the plot should be given. For example, the
command 
\begin{verbatim}
    set size 5, 4
\end{verbatim}
tells Gnu\TeX\ to use a 5 inch wide by 4 inch high box for the plot.
The default is 4 inches by 3 inches.  This is the size of the actual
plotting area; labels (see Section~\ref{label}) will extend outside of
this size.

When finished, the file will contain all of the plots you have
specified (you probably only want one plot per file). This file can
then be used in a \LaTeX\ document, \eg,
\singlespace
\begin{verbatim}
    \begin {figure}
      \begin{center}
        \input{plot}
      \end{center}
    \end {figure}
\end{verbatim}
\currentspace
This puts the plot into a figure. 

You will also want to read about the following commands, specifically
designed for the {\tt latex} output device: {\tt set title, set
xlabel, set ylabel, key, label, set style}, and {\tt set noclip}.
These are all described in the next section.

\subsection{Use with FIG}

Thanks to Micah Beck, author of Fig, Gnu\TeX\ now has a Fig driver.
Fig is an interactive drawing program that runs on Sun workstations
and under X windows. Files using the Fig language to describe the
pictures can be translated (with a suite of programs in the TransFig
package) to several other languages, such as PostScript, \TeX, and
\LaTeX.

If you choose the {\tt fig} terminal type in Gnu\TeX, a Fig format
file is produced that may be edited by Fig, translated by TransFig,
and printed or included in a \TeX\ or \LaTeX\ document. If you have
the EPIC or EEPIC macros, and your {\tt dvi} translator supports the
{\em tpic} \verb+\special+s, then you have the capability for very
good-quality output that draws curves with lines instead of dots. 
The reader is referred to the Fig and EPIC documentation for further
information. 

On the other hand, the Fig driver does not support user-defined
linestyles, nor the {\tt key} command.

The input file for Gnu\TeX\ should contain commands similar to these:
\singlespace
\begin{verbatim}
    set terminal fig
    set output "plot.fig"
    set size 5,4
\end{verbatim}
\currentspace
Note that the output file has a {\tt .fig} extension. To obtain EEPIC
output from a command file (called, say, {\tt plot.gnu}), use the
shell commands
\singlespace
\begin{verbatim}
     gnutex < plot.gnu
     fig2epic plot.fig plot.tex
\end{verbatim}
\currentspace
Include the file plot.tex in your document as before, along with the
document style options {\tt [epic,eepic]}. 

%%%%%%% Details section %%%%%%%%%%%%%%%%

\section{Details of Gnu\TeX\ Commands}
\label{details}

Gnu\TeX\ is case sensitive (commands and function names written in
lowercase are not the same as those written in CAPS).  All command
names may be abbreviated, as long as the abbreviation is not
ambiguous. Note that identifiers, such as variable names, function
names, and style names (including predefined styles) may not be
abbreviated.

Long commands may be split over several input lines by including a
backslash (\verb+\+) as the last character. The total command length
is limited to 511 characters. The backslash and newline will be
ignored; no white space is implied. The backslash must be the {\em
last} character on the line.

{\bf Comments} are allowed as follows: a sharp sign (\verb+#+) may
appear in most places in a line causing Gnu\TeX\ to ignore the rest of
the line.  They will not have this affect inside quotes, inside
numbers (including complex numbers), inside command substitutions, and
so on.  In short, they work anywhere it makes sense to work. Note that
the comment continues to the end of the command, including other input
lines that are continuations (mentioned above). Thus ``commenting
out'' a line that is continued will comment out all lines of that
command.

\paragraph{Start-up:} When Gnu\TeX\ is run, it looks for an
initialization file to execute.  This file is called {\tt .gnutex} on
Unix systems, and {\tt GNUTEX.INI} on other systems.  If this file is
not found in the current directory, the program will look for it in
your home directory (under MS-DOS, the environment variable {\tt
GNUTEX} should contain the name of this directory).  If this file is
found, Gnu\TeX\ executes the commands in this file.  This is most
useful for setting your terminal type and defining any functions or
variables which you use often.  The variable {\tt pi} is already
defined for you.

Each of the commands in Gnu\TeX\ is described below in alphabetical
order, along with other topics (\eg, ``expressions''). When a command
has many variations, such as the {\tt set} command, the variations are
described in alphabetical order.

\subsection {The {\tt clear} command}
\label{clear}

This command erases the current screen or output device as specified
by {\tt set output}.  This usually generates a formfeed on hardcopy
devices.  Use {\tt set terminal} to set the device type.

\subsection{Command-line substitution}
Command-line substitution is specified by a system command enclosed in
backquotes (\verb+``+).  This command is spawned and the output it
produces replaces the name of the command (and backquotes) on the
command line.  Newlines in the output produced by the spawned command
are replaced with blanks.  This feature can be used anywhere on the
Gnu\TeX\ command line.

Some examples:
\begin{verbatim}
   a(x) = `leastsq`           # substitutes "`leastsq`" with output produced
                                by a program named leastsq.
   a(x) = `run leastsq.exe`   # same but for VMS.
\end{verbatim}

\subsection {The {\tt exit} command}
\label{exit}

{\tt exit}, {\tt quit} and your computer's {\em end-of-file\/} character
will exit Gnu\TeX.  All these commands will clear the output device
(as the {\tt clear} command does) before exiting.

\newpage
\subsection {Expressions}

In general, any mathematical expression accepted by C, FORTRAN,
Pascal, or BASIC is valid.  The precedence of these operators is
determined by the specifications of the C programming language.  White
space (spaces and tabs) is ignored inside expressions.

Complex constants may be expressed as \verb+{real,imag}+, where {\tt
real} and {\tt imag} must be numerical constants.  For example
\verb+{3,2}+ represents $3 + 2i$; \verb+{0,1}+ represents $i$ itself.

\subsubsection{Functions}

The functions in Gnu\TeX\ are the same as the corresponding functions
in the UNIX math library, except that all functions accept integer,
real, and complex arguments, unless otherwise noted.  The BASIC sgn()
function is also supported.

\begin{tabular}{|lll|} \hline
Function & Arguments & Returns \\ \hline
abs(x) & any  &  absolute value of {\tt x}, $|x|$; same type \\
abs(x) & complex &  length of {\tt x}, $\sqrt{{\mbox{real}(x)^{2} +
\mbox{imag}(x)^{2}}}$ \\
acos(x) & any  & $\cos^{-1} x$ (inverse cosine) in radians \\
arg(x) & complex & the phase of $x$ in radians \\
asin(x) & any  & $\sin^{-1} x$ (inverse sin) in radians \\
atan(x) & any  & $\tan^{-1} x$ (inverse tangent) in radians \\
besj0(x) & radians &  $j_{0}$ Bessel function of $x$ \\
besj1(x) & radians & $j_{1}$ Bessel function of $x$ \\
besy0(x) & radians & $y_{0}$ Bessel function of $x$ \\
besy1(x) & radians & $y_{1}$ Bessel function of $x$ \\
ceil(x) & any & $\lceil x \rceil$, largest integer not less than $x$
(real part) \\
cos(x) & radians & $\cos x$, cosine of $x$ \\
cosh(x) & radians & $\cosh x$, hyperbolic cosine of $x$ \\
exp(x) & any & $e^{x}$,  exponential function of $x$ \\
floor(x) & any & $\lfloor x \rfloor$,  smallest integer not greater
than $x$ (real part) \\
imag(x) & complex &  imaginary part of $x$ as a real number \\
int(x) & real &  integer part of $x$, truncated toward zero \\
log(x) & any & $\log_{e} x$,  natural logarithm (base $e$) of $x$ \\
log10(x) & any & $\log_{10} x$,  logarithm (base $10$) of $x$ \\
real(x) & any &  real part of $x$ \\
sgn(x) & any & 1 if $x>0$, -1 if $x<0$, 0 if $x=0$. imag($x$) ignored \\
sin(x) & radians & $\sin x$, sine of $x$ \\
sinh(x) & radians & $\sinh x$, hyperbolic sine $x$ \\
sqrt(x) & any & $\sqrt{x}$,  square root of $x$ \\
tan(x) & radians & $\tan x$,  tangent of $x$ \\
tanh(x) & radians & $\tanh x$, hyperbolic tangent of $x$\\
\hline
\end{tabular}

\newpage
\subsubsection{Operators}

The operators in Gnu\TeX\ are the same as the corresponding operators
in the C programming language, except that all operators accept
integer, real, and complex arguments, unless otherwise noted.  The
FORTRAN \verb+**+ (exponentiation) operator is also supported.

Parentheses may be used to change order of evaluation.  The following
tables show the operators provided in Gnu\TeX.

\begin{center}
\begin{tabular}{|ccl|} \hline
\multicolumn{3}{|c|}{Binary Operators} \\
Symbol & Example & Explanation \\ \hline
\verb@**@ & \verb@a**b@ & exponentiation\\
\verb@*@ & \verb@a*b@ & multiplication\\
\verb@/@ & \verb@a/b@ & division\\
\verb@%@ & \verb@a%b@ & modulo\\
\verb@+@ & \verb@a+b@ & addition\\
\verb@-@ & \verb@a-b@ & subtraction\\
\verb@==@ & \verb@a==b@ & equality\\
\verb@!=@ & \verb@a!=b@ & inequality\\
\verb@&@ & \verb@a&b@ & bitwise AND\\
\verb@^@ & \verb@a^b@ & bitwise exclusive OR\\
\verb@|@ & \verb@a|b@ & bitwise inclusive OR\\
\verb@&&@ & \verb@a&&b@ & logical AND\\
\verb@||@ & \verb@a||b@ & logical OR\\
\verb@?:@ & \verb@a?b:c@ & ternary operation\\
\hline
\end{tabular}
\end{center}

The ternary operator evaluates its first argument $a$. If it is true
(non-zero) the second argument $b$ is returned, otherwise the third
argument $c$ is returned.

\begin{center}
\begin{tabular}{|ccl|} \hline
\multicolumn{3}{|c|}{Unary Operators}\\
Symbol & Example & Explanation \\ \hline
\verb@-@ & \verb@-a@ & unary minus \\
\verb@~@ & \verb@~a@ & one's complement \\
\verb@!@ & \verb@!a@ & logical negation \\
\hline
\end{tabular}
\end{center}

\subsection{The {\tt help} command}
The {\tt help} command provides a help message on a variety of
topics, including most of the topics in this section. The command
takes optional arguments to specify what you would like help about. To
begin, simply type {\tt help} or a question mark ({\tt ?}). 

\subsection{The {\tt key} command (\LaTeX\ only)}
The {\tt key} command makes a key describing the curves on a plot.
Place any {\tt key} command {\em after} the corresponding {\tt plot}
command.  Its syntax is
\begin{syntax}
	key {\em x,y} "{\em description1\/}" with {\em style1} [, "{\em
description2\/}" with {\em style2\/}]$\ldots$
\end{syntax}

The key command looks a lot like a plot command. The coordinates $x,y$
specify the location of the key on the plot (see below).  The key is
drawn as a sequence of lines, with one plot described on each line. On
the left-hand side of each line is a representation that attempts to
mimic the way the curve is plotted (\eg, a bunch of dots for a line,
the point symbol for a point, \etc). On the right side of each line is
the text ``description'' given in the command. The lines are
vertically arranged so an imaginary straight line divides the left-
and right-hand sides of the key. It is the $x$-coordinate of this line
that you specify with the {\tt x} in the key command; the {\tt y} in
the key command is the bottom of the key.

For example, the plot command
\begin{verbatim}
     plot "foo" w points, "bar" w lines, "funky" w linespoints
\end{verbatim}
followed by
\begin{verbatim}
key 5,5 "This is foo" w points, "This is bar" w lines, "This is funky" w linespoints
\end{verbatim}
would give us a key that looks (roughly) like this:
\begin{center}
\shortstack{
 \makebox[0pt][r]{$\Diamond$} \makebox[0pt][l]{This is foo} \\
 \makebox[0pt][r]{\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}} \makebox[0pt][l]{This is bar} \\
 \makebox[0pt][r]{\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}$+$\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}} \makebox[0pt][l]{This is funky}
}
\end{center}

Any styles may be used in the key entries, including user-defined
styles. For the points and linespoints styles, the point type plotted
is determined in the same way as in the plot command, so your key
entries should be in the same order as in the plot command. Note that
a key entry with an empty (\ie, \verb+""+) description will not be
included in the key, but may be included to affect the point-type
determination.  For example, if you do not want to key the {\tt foo}
curve as above, but you want {\tt funky} to look right, the key
command is
\begin{verbatim}
     key 5,5 "" w points, "This is bar" w lines, "This is funky" w linespoints
\end{verbatim}
and gives us a key that looks (roughly) like this:
\begin{center}
\shortstack{
 \makebox[0pt][r]{\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}} \makebox[0pt][l]{This is bar} \\
 \makebox[0pt][r]{\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}$+$\hspace{2pt}\circle*{1}\hspace{2pt}\circle*{1}\hspace{2pt}} \makebox[0pt][l]{This is funky}
}
\end{center}

The key is fairly rough at this time and I may find ways to make it
look better. Suggestions are welcome.


\subsection{The {\tt label} Command (\LaTeX, Fig, and Imagen only)}
\label{label}
Arbitrary labels may be placed on the most recent plot, using the {\tt
label} command. Place any {\tt label} command {\em after} the
corresponding {\tt plot} command. The basic syntax is
\begin{syntax}
    label {\em x,y} "{\em text\/}"
\end{syntax}
where $x,y$ is some coordinate in your plot's coordinate system (the
commas are important). If for \LaTeX\ output, the text may be any
arbitrary \LaTeX\ input, and will be processed in LR mode.  The text
is centered at the point $x,y$.  The label command should follow the
plot command. Any number of labels may be placed.

If you want to adjust the way the label is positioned with respect to
the point $x,y$, add another parameter:
\begin{syntax} 
    label {\em x,y} "{\em text\/}" {\em pos}
\end{syntax}
where {\em pos} is one of \{{\tt r,l,t,b,lt,lb,rt,rb}\} indicating
that the text should be placed so that the point is at the right
center, left center, top center, bottom center, left top corner, and
so on.

An arrow can be drawn out from the point simply by giving its
length in problem coordinates, after the {\em pos}:
\begin{syntax} 
    label {\em x,y} "{\em text\/}" {\em pos length}
\end{syntax}
The length is defined to be the {\em horizontal} extent of the arrow,
unless the arrow is vertical, in which case it is the vertical extent
of the arrow.  The arrow is drawn {\em away from} the text; for
example, if {\em pos} is {\tt lt}, then {\em away} is defined to be up
and to the left.  If it is {\tt b}, {\em away} is defined to be down.
This allows for eight different directions of arrows.

Further control over the slope of the arrow can be gained by
specifying exactly the slope you want. You should read about vectors
on page 198 in the \LaTeX\ manual. The command looks like
\begin{syntax} 
    label {\em x,y} "{\em text\/}" {\em pos length, h-slope, v-slope}
\end{syntax} 
(all the commas are important). The values {\em h-slope} and {\em
v-slope} are integers in the range $[-4,4]$, which specify the slope
of the line (run, rise).  A horizontal line is {\tt 1,0}, vertical is
{\tt 0,1}.  The two numbers may not have a common divisor other than
$+1$ or $-1$.

Labels outside of the plotted boundaries are permitted but may
interfere with axes labels or other text; use at your own risk.

\subsection{The {\tt load} Command}

This command executes each line of the specified input file as if it
had been typed interactively.  Files created by the {\tt save}
command can later be {\tt load}ed.  Any text file containing valid
commands can be created and then executed by the {\tt load} command.
Files being {\tt load}ed may themselves contain {\tt load} commands.

The {\tt load} command must be the last command on the line.  The
syntax is
\begin{syntax}
     load "{\em input-file\/}"
\end{syntax}

The name of the input file must be enclosed in quotes.

\subsection{The {\tt plot} Command}
The {\tt plot} command is the primary command of the program.  It
displays functions and data in many, many ways.  The full syntax of
this command is:
\begin{syntax}
    plot [{\em ranges}] {\em function} [{\em style}] [, {\em function} [{\em style}]]$\ldots$
\end{syntax}

Where {\em function} is either a mathematical expression or the name
of a data file enclosed in quotes.  User-defined functions and
variables may also be defined here.  Square braces [,] denote optional
items.

A {\tt plot} command can be as simple as
\begin{verbatim}
     plot sin(x)
\end{verbatim}

or as complex as (!)
\begin{verbatim}
     plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points
\end{verbatim}

The details are discussed below.

\subsubsection{The {\tt plot} Command: Data Files}

Discrete data contained in a file can displayed by specifying the name
of the data file (enclosed in quotes) on the {\tt plot} command line.

Data files should contain one data point per line.  A data point may
be specified either as an $x$ and $y$ value separated by blank space,
or as just the $y$ value, in which case the program will use the
number of the coordinate as the $x$ value.  Coordinate numbers starts
at 0 and are incremented for each data point read.  Blank lines and
lines beginning with \verb+!+ or \verb+#+ will be treated as comments
and ignored.


This example compares the data in the file {\tt population.dat} to a
theoretical curve:
\singlespace
\begin{verbatim}
     pop(x) = 103*exp((1965-x)/10)
     plot [1960:1990] 'population.dat', pop(x)
\end{verbatim}
\currentspace

The file {\tt population.dat} might contain:
\singlespace
\begin{verbatim}
     ! Gnu population in Antarctica since 1965
     1965   103
     1970   55
     1975   34
     1980   24
     1985   10
\end{verbatim}
\currentspace

\subsubsection{The {\tt plot} Command: Ranges}

These two options specify the region of the plot that will be
displayed.

Ranges may be provided on the {\tt plot} command line as synonyms for
the {\tt set xrange} and {\tt set yrange} commands.  The syntax of a
range is one of
\begin{syntax}
\,    [{\em dummy-var} = {\em xmin} : {\em xmax}] \\
\,    [{\em dummy-var} = {\em xmin} : {\em xmax}] [{\em ymin} : {\em ymax}]
\end{syntax}
In this expression the square brackets ([,]) are literals and
therefore required, but the ``{\em dummy-var} {\tt =}'' is optional.

When specified, {\em dummy-var} is the independent variable ($x$ is
used by default) and the min and max terms can be expressions or
constants.

Both the min and max terms are optional.  The ``{\tt :}'' is also
optional if neither a min nor a max term is specified.  This allows
{\tt []} to be used as a null range specification. The default
$x$-range is {\tt [-10:10]}.  Specifying a $y$ range turns autoscaling
OFF.

Some examples follow:
\singlespace
\begin{verbatim}
    plot cos(x)                             # use current ranges
    plot [-10:30] sin(pi*x)/(pi*x)          # set xrange only
    plot [t = -10 :30]  sin(pi*t)/(pi*t)    # same, but use t as dummy-var
    plot [-pi:pi] [-3:3]  tan(x), 1/x       # set y and xranges
    plot [] [-2:sin(5)*-8] sin(x)**besj0(x) # set only yrange
    plot [:200] [-pi:]  exp(sin(x))         # set xmax and ymin only
\end{verbatim}
\currentspace

\subsubsection{The {\tt plot} Command: Styles}

Plots may be displayed in one of these styles: {\tt lines, points,
linespoints, impulses}, or {\tt dots}.  The {\tt lines} style connects
adjacent points with lines.  The {\tt points} style displays a small
symbol at each point.  The symbol is different for each curve on the
plot (more precisely, it rotates among the set of symbols $\{\Diamond,
+, \Box, \times, \triangle, \star\}$). The {\tt linespoints} style is a
combination of the previous two styles.  The {\tt impulses} style
displays a vertical line from the $x$ axis to each point. The {\tt
dots} style is like the {\tt points} style except a very tiny dot is
plotted at each point, and the symbol does not vary from plot to plot.
This is useful for plotting very many points to get a feel for the
distribution. In addition, for \LaTeX\ output only, there are
user-defined styles (see the {\tt set style} command in
Section~\ref{set-style}).

Default styles are chosen with the {\tt set function style} and {\tt
set data style} commands.

The syntax of the style option is simply
\begin{syntax}
    with {\em style}
\end{syntax}
where {\em style} is one of {\tt lines}, {\tt points}, {\tt
linespoints}, {\tt impulses}, {\tt dots}, or a user-defined style
name.  These keywords may NOT be abbreviated, though {\tt with} may be
abbreviated, for example, to {\tt w}.

Some examples are
\singlespace
\begin{verbatim}
    plot sin(x) with impulses              # sin(x) with impulses
    plot [-9:30]  sin(x) w points, cos(x)  # sin(x) with points, cos(x) default
    plot [] [-2:5] tan(x), "data.1" with l # tan(x) default, "data.1" with lines
    plot "leastsq.dat" w i                 # "leastsq.dat" with impulses
\end{verbatim}
\currentspace

\subsection{The {\tt print} Command}
With syntax
\begin{syntax}
   print {\em expression}
\end{syntax}
this command prints the value of {\em expression} (see {\tt
expressions}).

\subsection{The {\tt quit} Command}
{\tt quit} is a synonym for {\tt exit}.  See {\tt exit}.

\subsection{The {\tt save} Command}
This command saves either user-defined functions, variables, or both
to the specified file.
The syntax is 
\begin{syntax}
   save  [{\em option}] "{\em filename\/}"
\end{syntax}
where {\em option} is either {\tt functions} or {\tt variables}.  If
no option is used Gnu\TeX\ saves both functions and variables. The
filename must be enclosed in quotes.

All {\tt save}d files are written in text format and may be read by
the {\tt load} command.

\subsection{The {\tt set} and {\tt show} Commands}

The {\tt set} command sets {\em lots} of options.

The {\tt show} command shows their settings.  {\tt show all} shows all
the settings. See the corresponding {\tt set} command for information
about each {\tt show} command.

\subsubsection {The {\tt set autoscale} Command}

Autoscaling is the default for both the $x$ and $y$ axes.  If $y$
autoscaling is on, the $y$ axis is automatically scaled to fit the
range of the function or data being plotted.  If $x$ autoscaling is
on, the $x$ range is scaled to the data file(s) being plotted; any
functions plotted on the same curve will use the same range. If only
functions are plotted, the current $x$ range is used.

If autoscaling is not on for an axis, the current range for that axis
is used. The current range is the range used for the last plot
command, or defined by the {\tt set xrange} and {\tt set yrange}
commands, or \verb+[-10:10]+ initially.
The syntax is
\begin{syntax}
   set autoscale [{\em axes}] \\
   set noautoscale [{\em axes}] \\
   show autoscale
\end{syntax}

The optional {\em axes} parameter specifies the axes affected by the
command. If {\em axes} is {\tt x} or {\tt y}, the command affects the
$x$ or $y$ axis, respectively. If {\em axes} is {\tt xy}, {\tt yx}, or
absent, the command affects both axes.

\subsubsection{The {\tt set clip} Command}

Gnu\TeX\ normally clips (actually, does not plot at all) data points
that fall within but too close to the boundaries (this is so the large
symbols used for points will not extend outside the boundary lines).
With the user-defined styles of \LaTeX\ it is often desirable to make
smaller point symbols, and thus points near the boundaries may be
plotted. To turn off clipping, use {\tt set noclip}. To turn it back
on, use {\tt set clip}. The default is {\tt clip}. Without clipping
you may have points near the boundaries that look bad (for some
terminal types this may cause errors); try adjusting the $x$ and $y$
ranges.

\subsubsection{The {\tt set format} Command (\LaTeX, Fig, and Imagen only)}

The format of the tic-mark labels may be set with the {\tt set format}
command. The default format used for both axes is ``\verb+$%g$+'', but
other formats such as ``\verb+%.2f+'' or ``\verb+$%3.0f \mu$sec+'' are
often desirable.  Anything accepted by {\tt printf} when given a {\em
double-precision} number, and then (if using with \LaTeX) accepted by
\LaTeX\ in LR mode, will work. In particular, the formats {\tt f, e},
and {\tt g} will work, and the {\tt d, o, x, c, s}, and {\tt u}
formats will not work.  The syntax is
\begin{syntax}
    set format [{\em axes}] "{\em format-string\/}" \\
    show format
\end{syntax}

Where {\em axes} is either {\tt x}, {\tt y}, {\tt xy}, or nothing
(which is the same as {\tt xy}). The length of the string representing
a ticmark (after formatting with {\tt printf}) is restricted to 100
characters.

\subsubsection{The {\tt show functions} Command}
The {\tt show functions} command lists all user-defined functions and
their definitions. There is no {\tt set functions} command (but see
Section~\ref{user-def}, {\em User-defined functions}).  The syntax is
simply
\begin{syntax}
   show functions
\end{syntax}

\subsubsection{The {\tt set logscale} Command}

Log scaling may be set on the $x$ and/or the $y$ axis.
The syntax is
\begin{syntax}
    set logscale {\em axes} \\
    set nologscale \\
    show logscale
\end{syntax}
where {\em axes} is either {\tt x}, {\tt y}, or {\tt xy}.

\subsubsection{The {\tt set output} Command}
By default, plots are displayed to the standard output.  The {\tt set
output} command redirects the displays to the specified file or
device.  The syntax is
\begin{syntax}
    set output "{\em filename\/}" \\
    show output 
\end{syntax}

The filename must be enclosed in quotes.  If the filename is omitted,
output will be sent to the standard output.

\subsubsection{The {\tt set samples} Command}

The sampling rates of functions may be changed by the {\tt set
samples} command.  By default, sampling is set to 160 points.  A
higher sampling rate will produce more accurate plots, but will take
longer.  In generating plots, Gnu\TeX\ will use either the sampling
rate set or the resolution of the current output device, whichever is
smaller.

For plotting data files, the number of samples limits the number of
points that may be plotted. To plot larger data files, set the number
of samples to a higher value. A warning message is printed if the data
file has more points than can be plotted.

\begin{syntax}
    set samples {\em expression} \\
    show samples
\end{syntax}

\subsubsection{The {\tt set size} Command (\LaTeX, Fig, and Imagen only)}
The {\tt set size} command will set the size of the plot, in inches.
The syntax is
\begin{syntax}
    set size {\em w,h}
\end{syntax}
This command tells Gnu\TeX\ to use a $w$ inch wide by $h$ inch high
box for the plot.  This is the size of the actual plotting area;
labels (see the {\tt set xlabel}, {\tt set ylabel}, and {\tt set
title} commands) will extend outside of this size.

\subsubsection{The {\tt set {\em xxx} style} Command}
This command sets the default style for use with plotting functions or
data files. See the {\tt plot} command, {\tt style} options for more
information. See the {\tt set style} command for information on
defining your own plot styles.

The syntax of this command is
\begin{syntax}
    set function style {\em style} \\
    set data style {\em style} \\
    show function style \\
    show data style
\end{syntax}
where {\em style} is one of {\tt lines}, {\tt points}, {\tt
linespoints}, {\tt impulses}, {\tt dots}, or a user-defined style.
These style keywords may NOT be abbreviated.

\subsubsection{The {\tt set terminal} Command}

Gnu\TeX\ supports many different graphics devices.  Use the {\tt set
terminal} command to select the type of device for which Gnu\TeX\ will
produce output. The syntax is
\begin{syntax}
   set terminal [{\em terminal-type}] \\
   show terminal
\end{syntax}

If {\em terminal-type} is omitted, the program will list the available
terminal types.  {\em terminal-type} may be abbreviated.

Use the {\tt set output} command to redirect this output to a file or
device.

\subsubsection{The {\tt set title} Command}

The plot is labeled in a variety of ways.  A title may be provided for
the plot with {\tt set title} commands.  The title in effect at the
time of the {\tt plot} command is used, so it should be set before the
plot.  Once set, it retains its values until explicitly changed.
The syntax is
\begin{syntax}
    set title "{\em title-string\/}"
\end{syntax}

When not in \LaTeX or Imagen, the title shows up in the
upper-left-hand corner of the plot, whenever the plot is being
labeled.

With \LaTeX\ this may be more complex: 
\begin{verbatim}
    set title "This is a {\em very} long title\\because it has\\three lines"
\end{verbatim}

\subsubsection{The {\tt set style} Command (\LaTeX\ only)}
\label{set-style}

If you find the default ``dot'' approximation to lines to be
inadequate, or desire different curves on the same plot to have
different styles, then you can define your own style (up to 16 may be
defined).  A style may be defined at any time with a command of one of
the following forms:
\begin{syntax}
	   set style {\em name} {\em point} \\
	   set style {\em name} {\em spacing} {\em dot}$\ldots$ \\
	   set style {\em name} {\em point} {\em spacing} {\em dot}$\ldots$
\end{syntax}

The first form defines a style similar to {\tt points}, the second
similar to {\tt lines} and the third to {\tt linespoints}. The {\em
name} is any identifier, just as with user-defined variables and
functions (it may not be lines, points, impulses, linespoints, or
dots). To use the style, simply use the {\em name} where you would use
any of the standard linestyle names: {\tt with {\em name}}, {\tt set
data style {\em name}}, or {\tt set function style {\em name}}.

The {\em point} is a quoted string of \LaTeX\ source which describes
text to be plotted at each point. Picture-mode and math-mode commands
are the most useful.  For example, \verb+"\circle*{100}"+ draws a disk
1pt in diameter at each data point (the units of picture coordinates
in use are 1/100 point). \verb+"$\Diamond$"+ produces a large diamond
symbol ($\Diamond$).

The {\em spacing} and {\em dot} arguments define a line in terms of a
sequence of ``dots'' to be output every {\em spacing} points along the
line to be plotted. {\em spacing} is a real number whose units are
points. Each dot (up to 5 dots are allowed) is a quoted string of
\LaTeX\ text, as with the point above. The dots are plotted in rotation
along the whole curve.

Thus, to simulate a linespoints linestyle with alternating big and
little dots every 4pt along the curve but to use a plus sign at
each data point, 	 
\begin{verbatim}
    set style mine "$+$" 4 "\circle*{100}" "\circle*{200}"
\end{verbatim}

The default style is as if 
\singlespace
\begin{verbatim}
    set style lines 2 "\circle*{1}"
    set style linespoints <varies> 2 "\circle*{1}"
\end{verbatim}
\currentspace
had been executed. (The smallest circle that will be drawn is about
100 units; smaller sizes than this will use that smallest size).
Linespoints is special in that its points vary with each curve on the
plot. This is not possible to embody in a single user-defined
linestyle.

\subsubsection{The {\tt show variables} Command}
The {\tt show variables} command lists all user-defined variables and
their values. There is no {\tt set variables} command. To assign
variables, see Section~\ref{user-def}, {\em User-defined variables}.
The syntax is
\begin{syntax}
    show variables
\end{syntax}

\subsubsection{The {\tt set xlabel} Command (\LaTeX, Fig, and Imagen only)}
In {\tt latex} output, the plot is labeled in a variety of ways.  The
axes may be labeled and a title provided for the plot with {\tt set}
commands.  The labels in effect at the time of the {\tt plot} command
are used, so they should be set before the plot. Once set, they retain
their values until explicitly changed.  The syntax is
\begin{syntax}
    set xlabel "{\em string\/}"
\end{syntax}
The string may be quite complex, for example,
\begin{verbatim}
    set xlabel "This is the $x$ axis\\with more than two\\lines in the label"
\end{verbatim}
Here there are line breaks, and math mode is used to make the {\tt x}
look like a variable.

\subsubsection{The {\tt set xrange} Command}
The {\tt set xrange} command sets the horizontal range of values which
will be displayed.  This range may also be specified on the {\tt plot}
command line. The syntax is
\begin{syntax}
   set xrange [{\em xmin} : {\em xmax}]
\end{syntax}
where {\em xmin} and {\em xmax} terms are expressions or constants,
and are both optional. The square brackets ([,]), however, are
required.

\subsubsection{The {\tt set xtics} Command}
Sometimes the $x$- or $y$-axis numbers really don't mean anything, and
you would rather not have the numbers and tics printed on the axis. If
this is the case, insert one of
\begin{syntax}
    set noxtics \\
    set noytics
\end{syntax}
before the plot command. To turn them back on use
\begin{syntax}
    set xtics \\
    set ytics
\end{syntax}

\subsubsection{The {\tt set ylabel} Command (\LaTeX, Fig, and Imagen only)}
The {\tt set ylabel} command is similar to the {\tt set xlabel}
command, and labels the $y$-axis. Its syntax is slightly different,
however: 
\begin{syntax}
    set ylabel "{\em string\/}" [{\em shift}]
\end{syntax}

If the ylabel is not coming out quite right (too close to the plot),
its position may be adjusted with the optional second parameter, {\em
shift}.  This will slide the $y$ label about {\em shift} characters
further to the left (away from the plot). Positive and negative
integers are allowed. The default value of {\em shift} is zero.

\subsubsection{The {\tt set yrange} Command}
The {\tt set yrange} command sets the vertical range of values which
will be displayed. It is completely analogous to the {\tt set xrange}
command. This command turns autoscaling {\bf off}.  This range may
also be specified on the {\tt plot} command line.
The syntax is
\begin{syntax}
   set yrange [{\em ymin} : {\em ymax}]
\end{syntax}

Where {\em ymin} and {\em ymax} terms are expressions or constants,
and are both optional. The square brackets ([,]), however, are
required.

\subsubsection{The {\tt set ytics} Command}
See the {\tt set xtics} command.

\subsubsection{The {\tt set zero} Command}
Gnu\TeX\ will not display points when their imaginary parts are
greater than the {\tt zero} threshold.  The default {\tt zero} value
is $10^{-8}$. The syntax is
\begin{syntax}
  set zero {\em expression} \\
  show zero
\end{syntax}

\subsection{The {\tt shell} Command}
The {\tt shell} command spawns an interactive shell.  To return to
Gnu\TeX, type {\tt logout} if using VMS, {\tt exit} or your {\em
end-of-file\/} character if using Unix, or {\tt exit} if using MS-DOS.

A single shell command may be spawned by preceding it with the
\verb+!+ character at the beginning of a command line.  Control will
return immediately to Gnu\TeX\ after this command is executed.  For
example,
\begin{verbatim}
   ! ls
\end{verbatim}
prints a directory listing and then returns to Gnu\TeX.

\verb+$+ is accepted as a synonym for \verb+!+ in VMS.

\subsection{User-defined variables and functions}
\label{user-def}

You may define your own functions and variables, which may be used
anywhere.  To define a function, the syntax is
\begin{syntax}
    {\em function-name} ({\em dummy-var}) = {\em expression}
\end{syntax}
where {\em expression} is defined in terms of {\em dummy-var}.

To define a variable, the syntax is
\begin{syntax}
    {\em variable-name} = {\em constant-expression}
\end{syntax}

Some examples:
\begin{verbatim}
    w = 2
    q = floor(tan(pi/2 - 0.1))
    f(x) = sin(w*x)
    sinc(x) = sin(pi*x)/(pi*x)
    delta(t) = (t == 0)
    ramp(t) = (t > 0) ? t : 0
\end{verbatim}

The variable {\tt pi} is already defined for you.

See also {\tt show functions} and {\tt show variables}. See {\tt set
style} for defining your own linestyles.

%%%%%%%%% End of Details %%%%%%%%%%%%

\section{Command-line arguments}

The command line arguments are irrelevant for users of the \LaTeX\
driver. 

The command line to gnutex  looks like this:
\begin{syntax}
   gnutex [-l] [-p] [-x]
\end{syntax}

By default, gnutex does not place labels on plots.  However, with {\tt
-l} option, they will be printed. The labels consist of the $x$ and
$y$ ranges and tic spacings, an optional title, plus a listing of the
source (function or data file) for each curve. {\em This option does
not affect \LaTeX\ output.}

When using Gnu\TeX\ interactively, it will clear the screen before
plotting.  The {\tt -p} option will disable the pre-plot screen clear.
This is useful mainly when the output of Gnu\TeX\ is being sent to a
printer, where clearing the screen translates into printing a blank
page.

The {\tt -x} option enables debugging output, in case anyone wants to
play with personal enhancements.

\section{Bugs and deficiencies}

I list here four known bugs, several deficiencies, and some items
that are on my wish list.  Please send bug reports and suggestions to
\verb+dfk@cs.duke.edu+.

The most important known bug is actually in the stdio library for the
Sun4 operating system (SunOS Sys4-3.2). The {\tt \%g} format for {\tt
printf} sometimes incorrectly prints numbers (\eg, 200000.0 as ``2'').
Thus, tic mark labels may be incorrect on a Sun4 version of Gnu\TeX.
You may work around it by rescaling your data or by using the {\tt set
format} command to change the tic mark format to \verb+%7.0f+ or some
other appropriate format. This appears to have been fixed in SunOS
4.0.

Another bug: On a Sun3 under SunOS 4.0, and on Sun4's under Sys4-3.2
and SunOS 4.0, the {\tt sscanf} routine incorrectly parses
``00 12'' with the format {\tt "\%f \%f"} and reads 0 and 0 instead of
0 and 12.  This affects data input. If your data file contains $x$
coordinates that are zero but are specified like '00', '000' \etc,
then you will read the wrong $y$ values. Check your data files or do
not use a Sun4 until they fix the bug. It appears that this has {\em
not} been fixed in SunOS 4.0.

Another bug has to do with the way \LaTeX\ places objects in picture
mode. I use a \verb+\put(x,y){\makebox(0,0){point}}+ to place the
points of the graph on the plot. The \verb+point+ above is often
specified by the user, using a user-defined linestyle. This technique
allows the user to specify text, math mode, or picture mode objects
and to center them at the point $(x,y)$. This does not center, for
some reason, a \verb+\circle+ object. Thus, little circles used as
points in a user-defined linestyle will not be precisely at the data
points. This is especially noticeable in a linespoints-like style.
Anyone who has an explanation or solution to this problem is requested
to contact me.  Leslie Lamport could not explain it to my
satisfaction, and believes it is a feature, not a bug, of \LaTeX.

The last bug has to do with the way the curve is clipped when a point
lies outside the range of the plot. The curve is not drawn from the
last point to the edge, in the general direction, as it would with
some clipping. This can look awkward. 

Certainly, one of the biggest deficiencies are that curves are not
plotted with real lines, but as many dots. Decreasing the spacing of
the dots tends to cause \LaTeX\ to run out of memory. However, this
can be remedied with the use of the Fig driver.

The tic marks are determined automatically by Gnu\TeX. The only
control the user has is to turn them completely off. I would like to
add a command for the user to specify the exact tic marks to be
plotted. I would also like to allow non-numeric tic marks.

The key doesn't look very nice. I would like to find better ways to
display the curves, and to put a box around the key.

If sideways writing were possible, it might be fun to use for the
$y$-axis label. This is done by the Imagen driver. It would also be
nice to add different line styles (dotted, dashed, etc.).

And, since Gnu\TeX\ is derived from an old version of gnuplot, it
would be nice to add many of the newer features and bug fixes of the
latest version of gnuplot.

\section{Obtaining Gnu\TeX}

Gnu\TeX\ may be obtained with anonymous ftp to {\tt cs.duke.edu} by
obtaining the file {\tt pub/gnutex.tar.Z} or {\tt pub/gnutex.shar}.
These files always represent the most up-to-date version of Gnu\TeX.
Patches to update the program are also available there.

To install, uncompress and un-tar (or un-shar) the file you have
obtained. Look at README. Then examine the Makefile. You may want to
change the {\tt TERMFLAGS} definition to include only terminal types
you expect to use. You will need to make some decisions based on your
operating system. You will also have to decide where the helpfile will
reside. Then type make.

The {\tt lasergnu} shell script runs {\tt gnutex} on a command or file
presented as an argument, and sends the output to an Imagen laser
printer (using either its Tektronix emulation mode or Impress
directly). You may need to adjust this script for your local
conditions to make it available for users. Note that Gnu\TeX\ also
supports unixplot and QMS output, which may be useful for other
printer types.

\subsection{Obtaining Fig and TransFig}
TransFig is available via anonymous FTP from {\tt svax.cs.cornell.edu}
in the file
\begin{verbatim}
      ~/ftp/pub/fig/transfig.tar.Z
\end{verbatim}
It is also available by mail from the Clarkson archive server, and
will soon be available from the Rice server as well.  Note that a new
version (release 4) is expected in late March 1989.

\section*{Note}
I have no affiliation with the GNU project or the \TeX\ project. I
give full credit to Colin Kelley and Thomas Williams for their design
of {\tt gnuplot}, and note here that it is copyrighted by them. Also,
much of the text for Section~\ref{details} came from the help files,
which may have been originally written by them. I could not reach them
to obtain permission to distribute Gnu\TeX. Their restriction on the
use of their code holds for mine as well: ``You may use this code as
you wish if credit is given and this message is retained.'' See any of
the files comprising the source code for this restriction.

Please send bug reports and suggestions to \verb+dfk@cs.duke.edu+.

\end{document}