\HeaderA{rug}{Add a Rug to a Plot}{rug}
\keyword{aplot}{rug}
\begin{Description}\relax
Adds a \emph{rug} representation (1-d plot) of the data to the plot.
\end{Description}
\begin{Usage}
\begin{verbatim}
rug(x, ticksize = 0.03, side = 1, lwd = 0.5, col = par("fg"),
    quiet = getOption("warn") < 0, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A numeric vector
\item[\code{ticksize}] The length of the ticks making up the \sQuote{rug}.
Positive lengths give inwards ticks.
\item[\code{side}] On which side of the plot box the rug will be
plotted. Normally 1 (bottom) or 3 (top).
\item[\code{lwd}] The line width of the ticks.
\item[\code{col}] The colour the ticks are plotted in.
\item[\code{quiet}] logical indicating if there should be a warning about
clipped values.
\item[\code{...}] further arguments, passed to \code{\LinkA{axis}{axis}}, such
as \code{line} or \code{pos} for specifying the location of the rug.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Because of the way \code{rug} is implemented, only values of \code{x}
that fall within the plot region are included.  There will be a
warning if any finite values are omitted, but non-finite values are
omitted silently.

Because of the way colours are done the axis itself is redrawn in the
same colour, \code{lty} and \code{lwd} as the ticks.  You can
replot the box if you don't like this feature.
\end{Details}
\begin{References}\relax
Chambers, J. M. and Hastie, T. J. (1992)
\emph{Statistical Models in S.}
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{jitter}{jitter}} which you may want for ties in \code{x}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
require(stats)# both 'density' and its default method
with(faithful, {
    plot(density(eruptions, bw = 0.15))
    rug(eruptions)
    rug(jitter(eruptions, amount = 0.01), side = 3, col = "light blue")
})
\end{ExampleCode}
\end{Examples}

