\HeaderA{lag.plot}{Time Series Lag Plots}{lag.plot}
\keyword{hplot}{lag.plot}
\keyword{ts}{lag.plot}
\begin{Description}\relax
Plot time series against lagged versions of themselves.
Helps visualizing \dQuote{auto-dependence} even when auto-correlations
vanish.
\end{Description}
\begin{Usage}
\begin{verbatim}
lag.plot(x, lags = 1, layout = NULL, set.lags = 1:lags,
         main = NULL, asp = 1,
         font.main=par("font.main"), cex.main=par("cex.main"),
         diag = TRUE, diag.col = "gray", type = "p", oma = NULL,
         ask = NULL, do.lines = (n <= 150), labels = do.lines, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] time-series (univariate or multivariate)
\item[\code{lags}] number of lag plots desired, see arg \code{set.lags}.
\item[\code{layout}] the layout of multiple plots, basically the \code{mfrow}
\code{\LinkA{par}{par}()} argument.  The default uses about a square
layout (see \code{\LinkA{n2mfrow}{n2mfrow}} such that all plots are on one page.
\item[\code{set.lags}] positive integer vector allowing to specify the set of
lags used; defaults to \code{1:lags}.
\item[\code{main}] character with a main header title to be done on the top
of each page.
\item[\code{asp}] Aspect ratio to be fixed, see \code{\LinkA{plot.default}{plot.default}}.
\item[\code{font.main, cex.main}] attributes for the title, see \code{par()}.
\item[\code{diag}] logical indicating if the x=y diagonal should be drawn.
\item[\code{diag.col}] color to be used for the diagonal \code{if(diag)}.
\item[\code{type}] plot type to be used, but see \code{\LinkA{plot.ts}{plot.ts}} about
its restricted meaning.
\item[\code{oma}] outer margins, see \code{\LinkA{par}{par}}.
\item[\code{ask}] logical; if true, the user is asked before a new page is started.
\item[\code{do.lines}] logical indicating if lines should be drawn.
\item[\code{labels}] logical indicating if labels should be used.
\item[\code{...}] Further arguments to \code{\LinkA{plot.ts}{plot.ts}}.
\end{ldescription}
\end{Arguments}
\begin{Note}\relax
It is more flexible and has different default behaviour than
the S version.  We use \code{main =} instead of \code{head = } for
internal consistency.
\end{Note}
\begin{Author}\relax
Martin Maechler
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{plot.ts}{plot.ts}} which is the basic work horse.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
lag.plot(nhtemp, 8, diag.col = "forest green")
lag.plot(nhtemp, 5, main="Average Temperatures in New Haven")
## ask defaults to TRUE when we have more than one page:
lag.plot(nhtemp, 6, layout = c(2,1), asp = NA,
         main = "New Haven Temperatures", col.main = "blue")

## Multivariate (but non-stationary! ...)
lag.plot(freeny.x, lag = 3)
## Not run: 
no lines for long series :
lag.plot(sqrt(sunspots), set = c(1:4, 9:12), pch = ".", col = "gold")
## End(Not run)
\end{ExampleCode}
\end{Examples}

