\Header{polygon}{Polygon Drawing}
\keyword{aplot}{polygon}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x,y}] vectors containing the coordinates of the vertices
of the polygon.
\item[\texttt{density}] density of fill pattern. \emph{NOT YET} implemented.
\item[\texttt{angle}] angle of fill pattern. \emph{NOT YET} implemented.
\item[\texttt{border}] the color to draw the border.  Defaults to
\texttt{\Link{par}("fg")}.  Use \texttt{border=0} to omit borders.
\item[\texttt{...}] graphical parameters can be given as arguments to
\texttt{polygon}, must importantly,
\item[\texttt{col}] an integer specifying the color to be used in
filling the polygon.  The default is to leave polygons unfilled.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{polygon} draws the polygons whose vertices are
given in \texttt{x} and \texttt{y}.\end{Description}
\begin{SeeAlso}
\texttt{\Link{segments}} for even more flexibility,
\texttt{\Link{lines}}, \texttt{\Link{rect}}, \texttt{\Link{box}}, \texttt{\Link{abline}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
n <- 100
xx <- c(0:n, n:0)
yy <- c(c(0,cumsum(rnorm(n))), rev(c(0,cumsum(rnorm(n)))))
plot   (xx, yy, type="n", xlab="Time", ylab="Distance")
polygon(xx, yy, col="gray", border = "red")
title("Distance Between Brownian Motions")
\end{ExampleCode}
\end{Examples}

