Learn R Programming

playwith (version 0.8-56)

xyCoords: Get playwith plot data points

Description

Part of the playwith Application Programming Interface.

Usage

xyCoords(playState, space = "plot")
xyData(playState, space = "plot")

Arguments

playState
a playState object representing the plot, window and device.
space
character, the plot space for which to get data. This is only relevant to multi-panel lattice plots, where data is split across panels. In this case, if space="page", the combined data from all panels is returned. See the space

Value

  • the returned value is a list with elements x and y, which are numeric vectors in the case of xyCoords. For lattice plots, the output is similar to that returned by trellis.panelArgs, so can include elements such as subscripts. In addition, the x and y vectors are recycled to the same length, and coordinates of qqmath plots are automatically calculated.

Details

xyCoords is analogous to xy.coords. xyData is the same but does not convert the data to numeric. Thus the returned data objects may be factors, time series, etc.

See Also

playwith.API

Examples

Run this code
if (interactive()) {

library(lattice)
x <- as.Date("1990-01-01") + 1:20 - 1
ab <- rep(c("a", "b"), each=10)
playwith(xyplot(1:20 ~ x | ab))
playState <- playDevCur()
xyCoords(playState, space="packet 2")
xyData(playState, space="packet 2")
xyData(playState, space="page")

}

Run the code above in your browser using DataLab