Plot zoo Series with Lattice
xyplot.zoo.Rdxyplot methods for time series objects (of class "zoo",
"its", or "tis").
Usage
# S3 method for class 'zoo'
xyplot(x, data, ...)
# S3 method for class 'zoo'
llines(x, y = NULL, ...)
# S3 method for class 'zoo'
lpoints(x, y = NULL, ...)
# S3 method for class 'zoo'
ltext(x, y = NULL, ...)
panel.segments.zoo(x0, x1, ...)
panel.rect.zoo(x0, x1, ...)
panel.polygon.zoo(x, ...)Arguments
- x, x0, x1
time series object of class
"zoo","its"or"tis". Forpanel.plot.defaultit should be a numeric vector.- y
numeric vector or matrix.
- data
not used.
- ...
arguments are passed to
xyplot.ts, and may be passed through toxyplotandpanel.xyplot.Some of the commonly used arguments are:
screensfactor (or coerced to factor) whose levels specify which graph each series is to be plotted in.
screens = c(1, 2, 1)would plot series 1, 2 and 3 in graphs 1, 2 and 1. This also defines the strip text in multi-panel plots.scalesthe default is set so that all series have the
"same"X axis but"free"Y axis. Seexyplotin the lattice package for more information onscales.layoutnumeric vector of length 2 specifying number of columns and rows in the plot, see
xyplotfor more details. The default is to fill columns with up to 6 rows.xlabcharacter string used as the X axis label.
ylabcharacter string used as the Y axis label. If there are multiple panels it may be a character vector the same length as the number of panels, but NOTE in this case the vector should be reversed OR the argument
as.tableset toFALSE.lty, lwd, pch, type, colgraphical arguments passed to
panel.xyplot. These arguments can also be vectors or (named) lists, see details for more information.
Details
xyplot.zoo plots a "zoo", "its" or "tis"
object using xyplot.ts from
lattice. Series of other classes are coerced to "zoo"
first.
The handling of several graphical parameters is more
flexible for multivariate series. These parameters can be
vectors of the same length as the number of series plotted or
are recycled if shorter. They can also be (partially) named list, e.g.,
list(A = c(1,2), c(3,4)) in which c(3, 4) is the
default value and c(1, 2) the value only for series A.
The screens argument can be specified in a similar way.
Note that since zoo 1.6-3 plot.panel.default and
plot.panel.custom are no longer necessary, as normal panel
functions (panel.xyplot by default) will work.
Similarly, there are now methods for the generic lattice drawing
functions llines,
lpoints, and
ltext. These can also be called as
panel.lines, panel.points, and panel.text,
respectively. The old interfaces (panel.lines.zoo,
panel.points.zoo, and panel.text.zoo), will be
removed in future versions. panel.polygon.zoo may also be
removed.