1.11.1 Arrows

The set arrow command may be used to draw arrows on top of graphs; its syntax is illustrated by the following simple example:

set arrow 1 from 0,0 to 1,1

Optionally, a third coordinate may be specified. On 2D plots, this is ignored. If no third coordinate is supplied then a value of $$z=0$ is substituted when the arrow is plotted on 3D graphs. The number {\tt 1} immediately following {\tt set arrow}\index{set arrow command@{\tt set arrow} command} specifies an identification number for the arrow, allowing it to be subsequently removed via the command 

\begin{verbatim} 
unset arrow 1
\end{verbatim}

\noindent or equivalently, via\index{set noarrow command@{\tt set noarrow} command} 

\begin{verbatim} 
set noarrow 1
\end{verbatim}

\noindent or to be replaced with a different arrow by issuing a new command of the form {\tt set arrow 1~ ...}. The {\tt set arrow} command may be followed by the keyword {\tt with} to specify the style of the arrow. The keywords {\tt nohead}\index{nohead keyword@{\tt nohead} keyword}, {\tt head}\index{head keyword@{\tt head} keyword} and {\tt twohead}\index{twohead keyword@{\tt twohead} keyword}, placed after the keyword {\tt with}, can be used to generate arrows with no arrow heads, normal arrow heads, or with two arrow heads. {\tt twoway}\index{twoway keyword@{\tt twoway} keyword} is an alias for {\tt twohead}\index{twohead keyword@{\tt twohead} keyword}, as in the following example: 

\begin{verbatim} 
set arrow 1 from 0,0 to 1,1 with twoway
\end{verbatim}

\noindent Line types, line widths and colors can also be specified after the keyword {\tt with}, as in the example: 

\begin{verbatim} 
set arrow 1 from 0,0 to 1,1 with nohead \
linetype 1 c blue
\end{verbatim}

The coordinates for the start and end points of the arrow can be specified in a range of coordinate systems. The coordinate system to be used should be specified immediately before the coordinate value. The default system, {\tt first}\index{coordinate systems!first@{\tt first}} measures the graph using the {\tt x}- and {\tt y}-axes. The {\tt second}\index{coordinate systems!second@{\tt second}} system uses the {\tt x2}- and {\tt y2}-axes. {\tt axis<n>}\index{coordinate systems!axis<n>@{\tt axis<n>}} specifies that the position is to be measured along the 

$n $th horizontal or vertical axis – for example, {\tt axis3}.\index{set arrow command@{\tt set arrow} command} This allows the graph to be measured with reference to any arbitrary axis on plots which make use of large numbers of parallel axes (see Section~ \ref{sec:multiple_ axes}). The {\tt page}\index{coordinate systems!page@{\tt page}} and {\tt graph}\index{coordinate systems!graph@{\tt graph}} systems both measure in centimeters from the origin of the graph. In the following example, we use these specifiers, and specify coordinates using variables rather than doing so explicitly: 

\begin{verbatim} 
x0 = 0.0
y0 = 0.0
x1 = 1.0
y1 = 1.0
set arrow 1 from first  x0, first  y0 \
            to   screen x1, screen y1 \
            with nohead
\end{verbatim}

$