Learn R Programming

zoo (version 1.8-11)

xyplot.zoo: Plot zoo Series with Lattice

Description

xyplot methods for time series objects (of class "zoo", "its", or "tis").

Usage

# S3 method for zoo
xyplot(x, data, ...)

# S3 method for zoo llines(x, y = NULL, ...) # S3 method for zoo lpoints(x, y = NULL, ...) # S3 method for zoo ltext(x, y = NULL, ...)

panel.segments.zoo(x0, x1, ...) panel.rect.zoo(x0, x1, ...) panel.polygon.zoo(x, ...)

Value

Invisibly returns a "trellis" class object. Printing this object using print will display it.

Arguments

x, x0, x1

time series object of class "zoo", "its" or "tis". For panel.plot.default it should be a numeric vector.

y

numeric vector or matrix.

data

not used.

...

arguments are passed to xyplot.ts, and may be passed through to xyplot and panel.xyplot.

Some of the commonly used arguments are:

screens

factor (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.

scales

the default is set so that all series have the "same" X axis but "free" Y axis. See xyplot in the lattice package for more information on scales.

layout

numeric vector of length 2 specifying number of columns and rows in the plot, see xyplot for more details. The default is to fill columns with up to 6 rows.

xlab

character string used as the X axis label.

ylab

character 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.table set to FALSE.

lty, lwd, pch, type, col

graphical 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.

See Also

xyplot.ts, zoo, plot.ts, barplot, plot.zoo