\Header{polygon}{Polygon Drawing}
\keyword{aplot}{polygon}
\begin{Description}\relax
\code{polygon} draws the polygons whose vertices are
given in \code{x} and \code{y}.\end{Description}
\begin{Arguments}
\begin{ldescription}
\item[\code{x,y}] vectors containing the coordinates of the vertices
of the polygon.
\item[\code{density}] density of fill pattern. \emph{NOT YET} implemented.
\item[\code{angle}] angle of fill pattern. \emph{NOT YET} implemented.
\item[\code{border}] the color to draw the border.  Defaults to
\code{\Link{par}("fg")}.  Use \code{border=0} to omit borders.
\item[\code{...}] graphical parameters can be given as arguments to
\code{polygon}, must importantly,
\item[\code{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{SeeAlso}\relax
\code{\Link{segments}} for even more flexibility,
\code{\Link{lines}}, \code{\Link{rect}}, \code{\Link{box}}, \code{\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}

