\Header{plot.ts}{Plotting Time-Series Objects}
\alias{lines.ts}{plot.ts}
\alias{plot.mts}{plot.ts}
\keyword{hplot}{plot.ts}
\keyword{ts}{plot.ts}
\begin{Description}\relax
Plotting methods for objects of class \code{"ts"} or \code{"mts"}
(multivariate time-series).\end{Description}
\begin{Usage}
\begin{verbatim}
plot(x, y = NULL, type = "l", frame.plot = axes,
     plot.type = c("multiple", "single"),
     xy.labels = n <= 150, xy.lines = do.lab, panel=lines, ...)

lines(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x,y}] time series objects, usually of class \code{"ts"}.
\item[\code{type}] the type of plot, see \code{\Link{plot}}.  When \code{y}
is present, the default will depend on \code{xy.labels}, see below.
\item[\code{frame.plot}] a function to give the `frame' for each panel.
\item[\code{plot.type}] for multivariate time series, should the series by
plotted separately (with a common time axis) or on a single plot?
\item[\code{xy.labels}] logical, indicating if \code{\Link{text}()} labels
should be used for an x-y plot.
\item[\code{xy.lines}] logical, indicating if \code{\Link{lines}}
should be drawn for an x-y plot.  Default is true, when labels are
drawn as well.
\item[\code{panel}] a \code{function(x, col, bg, pch, type, ...)} which gives the
action to be carried out in each panel of the display for
\code{plot.type="multiple"}.  The default is \code{lines}.
\item[\code{...}] additional graphical arguments, see \code{\Link{plot}},
\code{\Link{plot.default}} and \code{\Link{par}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
With one principal argument, these functions create time series
plots, for multivariate series of two kinds depending on \code{plot.type},

If \code{y} is present, both \code{x} and \code{y} must be univariate,
and a ``scatter'' plot \code{y \textasciitilde{} x} will be drawn, enhanced by
using \code{\Link{text}} if \code{xy.labels} is
\code{\Link{TRUE}} or \code{character}, and \code{\Link{lines}} if
\code{xy.lines} is \code{TRUE}.\end{Details}
\begin{SeeAlso}\relax
\code{\Link{ts}} for basic time series construction and access
functionality.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

## Multivariate
z <- ts(matrix(rt(300, df = 3), 100, 3), start=c(1961, 1), frequency=12)
plot(z)                # multiple
plot(z, panel=points)  # same with points instead of lines
plot(z, plot.type="single", lty=1:3)

## A phase plot:
data(nhtemp)
plot(nhtemp, c(nhtemp[-1], NA), cex = .8, col="blue",
     main = "Lag plot of New Haven temperatures")
## a clearer way to do this would be
library(ts)
plot(nhtemp, lag(nhtemp, 1), cex = .8, col="blue",
     main = "Lag plot of New Haven temperatures")


library(ts)

data(sunspots)
## xy.lines and xy.labels are FALSE for large series:
plot(lag(sunspots, 1), sunspots, pch = ".")

data(EuStockMarkets)
SMI <- EuStockMarkets[, "SMI"]
plot(lag(SMI,  1), SMI, pch = ".")
plot(lag(SMI, 20), SMI, pch = ".", log = "xy",
     main = "4 weeks lagged SMI stocks -- log scale", xy.lines= TRUE)

detach("package:ts") 
\end{ExampleCode}
\end{Examples}

