\chapter{Aesthetics}

\section{Labels}

This chapter describes the various options available to change
the appearance of the plot.
One of the most common things to do is to add labels,
using the {\tt LAbel} command.
To put the label ``Time (sec)'' on the $x$-axis,
``Distance'' on the $y$-axis, and ``My data'' at the top of the plot,
\begin{verbatim}
PLT> LA X Time (sec)
PLT> LA Y Distance
PLT> LA T My data
PLT> P
\end{verbatim}
You will notice that only certain PLT commands
cause the graphics display to be updated.
This allows you to enter several commands quickly
without having to wait for the screen to be redrawn after each command.
Whenever you want to see what the current graph looks like,
you should enter the {\tt Plot} command or just {\tt P}.

There are also {\em Outer} labels
(called {\tt OX}, {\tt OY}, {\tt OT}) that can be used.
These outer labels provide a simple way to create labels
that need to lie on two lines.
For example, the commands
\begin{verbatim}
PLT> LA X Universal
PLT> LA OX Time (sec)
PLT> P
\end{verbatim}
would label the $x$-axis with two lines of text
with the word ``Universal'' being written above the words ``Time (sec)''.
Now what do you think the following command will do?
\begin{verbatim}
PLT> LA OT Fun! Fun! Fun!
PLT> P
\end{verbatim}
If you try this you will find that only the word ``Fun'' appears.
This is because \verb@ ! @ is the PLT comment character.
If you wish to enter a PLT command that contains the comment character,
then you must enclose the entire argument in quotation marks:
\begin{verbatim}
PLT> LA OT "Fun! Fun! Fun!"
PLT> P
\end{verbatim}

To remove any label, enter the command with no text; thus,
\begin{verbatim}
PLT> LA OT
PLT> P
\end{verbatim}
will remove the text ``Fun! Fun! Fun!'' from the graph.
The name of the QDP file appears in the {\tt File} position;
thus the command \, {\tt LA~F} \, will remove this name.
The time-stamp that appears at the bottom of the plot
can be removed with the \, {\tt Time~OFf} \, command
and, of course, \, {\tt Time~ON} \, will turn it back on.
In general, you should leave the file name and time-stamp in place,
as this information is very useful on a hardcopy.
Sometimes, when working with a slow plotting device,
you will want to speed things up by not plotting any labels.
This can be done the \, {\tt LAbel~OFf} \, command.
Of course, you should issue the \, {\tt LAbel~ON} \, command
before making a hardcopy.

Text is drawn with PGPLOT;
so the standard PGPLOT escape sequences are used.
Hence, the commands
\begin{verbatim}
PLT> LA T \gx\u2
PLT> P
\end{verbatim}
will label the top of the graph with $\chi^2$.
The default font is the PGPLOT {\em Normal font},
which draws rather quickly.
For journal quality text, you should override the default font
with the \, {\tt FOnt~Roman} \, command.
This will cause all text, including the numeric labels on the axes,
to be written in the nicer looking, but slower plotting, Roman font.
Use \, {\tt FOnt~?} \, to get a list of possible fonts.

It is also possible to place a {\em numbered label} anywhere in the plot.
To see this, try
\begin{verbatim}
PLT> LA 1 Pos 2 4 LIne -45 "Point at (2,4)"
PLT> P
\end{verbatim}
The above command plots LAbel 1 at Position (2,4)
with a LIne extending at an angle of -$45^\circ$
to the $x$-axis and with the text message ``Point at (2,4)''.
Each attribute can be set individually.
Hence, if you decide you don't like the line extending downwards, you
could change the angle with
\begin{verbatim}
PLT> LA 1 LIne 135
PLT> P
\end{verbatim}
This leaves the pointing position and text unaffected,
but resets the angle of the line
(and also the justification of the string).

\section{Vertical plots}

When you first plotted the {\tt DEMO.QDP} file,
two plot groups were plotted on the same panel.
It is possible to plot each plot group
on a separate panel in a vertical stack.
To see this, try
\begin{verbatim}
$ QDP DEMO
(enter device type)
PLT> Plot Vertical
PLT> Plot
\end{verbatim}
The \, {\tt Plot~Vertical} \, command resets the internal parameters
so that each visible plot group will be plotted in a separate
panel in a vertical stack.
Nothing is replotted
until the {\tt Plot} command alone is issued.
This allows you to reset other parameters,
without having to wait for a new graph to be drawn.

The $y$-scale can be adjusted in each panel separately.
Hence,
\begin{verbatim}
PLT> R Y2 0 10
PLT> R Y3 0 50
PLT> P
\end{verbatim}
will set the $y$-range of the top panel to be 0 to 10
and of the bottom panel to be 0 to 50.
The \, {\tt R~?} \, command can be used at any time to display
the current ranges.
At this point it would be wise to label each plot group.
So enter
\begin{verbatim}
PLT> LA G1 x-axis
PLT> LA G2 group 2
PLT> LA G3 group 3
PLT> P
PLT> R ?
 Current Gap=   .025
Window   XLAB      XMIN        XMAX         YLAB      YMIN        YMAX
   2 : x-axis      .9250    ,  4.075     : group 2     .0000    ,  10.00    
   3 : x-axis      .9250    ,  4.075     : group 3     .0000    ,  50.00    
PLT>
\end{verbatim}
The \, {\tt R~?} \, prints out the beginning of each label
and therefore, with a good set of labels,
it is easy to keep track of what is plotted where.

At this point it is worth pointing out the difference between plot
groups, and the rescale parameters.
A plot group is a group of associated data points that cannot be
displayed in different panels.
The {\tt Rescale} command affects the scale of the designated panel.
Thus, {\tt R~Y2~0~10} will set the $y$-scale in the second panel
to range from 0 to 10.
For maximum compatibility with previous versions of PLT,
the {\tt Plot Vert} command plots group 2 on panel 2.
The command {\tt LAbel G1} will associate a label with a plot group.
Thus if you enter the commands \, {\tt Xaxis~2}, \,
{\tt Plot Vert}, and then {\tt Plot},
you will find that plot group 2 now determines the $x$-axis
and hence the label ``group 2'' is now used as the $x$-label.
Plot group 1 is now plotted in the top panel,
with the same label ``x-axis'' which,
of course, this is no longer correct.

To undo the effects of the \, {\tt Plot~Vertical} \, command,
you should enter
\begin{verbatim}
PLT> Plot Overlay
PLT> P
\end{verbatim}
The $y$-axis label is the label of the first plot group to be
plotted in that panel.
Since now more than one group appears in the panel,
this is now longer most appropriate.
To override the $y$-axis label in a given panel,
use the {\tt LAbel~Y} command.
In other words the \, {\tt LA~Y} \, command
can be used to denote all the $y$ plot groups in a given panel,
whereas {\tt G1}, {\tt G2}, {\it etc}. will associate
a label with the specified plot group.

\section{Colors, lines, and markers}
The default mode of PLT is to plot group 1 with color index 1,
group 2 with color index 2, {\it etc.}
The \, {\tt COlor~?} \,  command can be used to generate
a list of the default colors used to plot each color index.
The command \, {\tt COlor~3~ON~2} \, will cause color index 3
to be used with group 2 is plotted.
With the PGPLOT default colors,
this means that group 2 will now be plotted in green.
It is important to realize that the {\tt COlor} command
changes the color index and only indirectly, the color.

Due to historical accident the {\tt COlor} command can be used to
prevent plot groups from being plotted.
This is because color 0 corresponds to no-color or invisible.
Thus {\tt COlor~0~ON~2} will suppress the plotting of group 2.
A cleaner way to do this is with the command {\tt COlor~OFf~2}.
A {\tt COlor~OFf} command followed by a {\tt COlor ON} command will
restore the original color index.
The \, {\tt R~Y} \, (with no arguments) command only uses plot groups
that are visible to determine the default scale.
For example, assume you are working with 6 plot groups
and the values of groups 1 to 5 all lie in the range of 0.0 to 1.0,
whereas the values in group 6 all lie near 100,000.
For this example, the commands

\begin{verbatim}
PLT> COlor OFF 6
PLT> R Y
\end{verbatim}
would redraw the graph,
and the default $y$-range will lie between 0.0 and 1.0.

In the above examples, PLT drew a line between the points being plotted.
If you wish to display the plot with markers, then you should turn
on the plotting of markers with
\begin{verbatim}
PLT> MArk ON
PLT> P
\end{verbatim}
For this example, the line connecting the various points disappears
and only markers will be drawn.
PLT draws a line when (a) all attributes
({\tt LIne}, {\tt MArker}, and {\tt Errors}) are {\tt OFF}
or (b) the line attribute is {\tt ON}.
Thus if you want both the connecting line and markers to appear,
then you need to turn on the {\tt LIne} attribute with
\begin{verbatim}
PLT> LIne ON
PLT> P
\end{verbatim}

The command \, {\tt MArker~Size~2} \,
can be used to make the markers twice as big.
The default marker style for all plot groups is type 2
as this marker plots very quickly.
To change the style of the marker, try \, {\tt MArker~9~ON~2} \,
to use marker style 9 when plotting group 2.
The command \, {\tt MArker~?} \, will display a table of marker styles.

\section{Log scale}

It is also possible to plot the data on a log scale.
To do this, type
\begin{verbatim}
PLT> LOg Y
PLT> P
\end{verbatim}
Use \, {\tt LOg~X} \, to use a log scale on the $x$-axis.
The {\tt LOg~OFf} command will turn off the log scale on both
the $x$- and $y$- axes.
Note: Using {\tt LOg} does not cause the data to be altered,
only the appearance of the plot changes.
If the lower limit of the scale being logged is negative or zero,
then PLT will rescan the data searching for the smallest positive
value, and make that the lower limit.

You should also be aware of the fact that the size of the gap,
created by the {\tt GAp} command is affected by log scale.
Thus for a non-zero gap, the sequence {\tt R~X} followed by {\tt LOg~X}
produces a different range than {\tt LOg~X} followed by {\tt R~X}.
In the first case, the data minimum and maximum values are found,
and then gap added in linear space.
Applying the {\tt LOg} command does not change this scale.
In the second case, the scale is first logged, then the data minimum
and maximum values are found.
At this point the correct gap for a log plot is added.
