Extract (x, y, z) plotting coordinates, where z is a matrix.
xyzmat.coords(x = NULL, y = NULL, z = NULL,
xlab = NULL, ylab = NULL, zlab = NULL,
xds = NULL, yds = NULL, zds = NULL)
Numeric vectors.
A matrix
Labels
Results from deparse(substitute(x))
(etc.); see below.
A list with the following components:
X coordinates
Y coordinates
Z matrix
Label for X axis
Label for Y axis
Label for Z axis
This function is similar to xyz.coords
, except that this function accepts a matrix for z
.
If x
is the same length as nrow(z)
, x
will be taken as the points at which the z
values were sampled. If x
is the length of nrow(z) + 1
, x
is taken as the breakpoints between bins. If x
is missing, the matrix indices (1:nrow(z)
) will be used. Similarly for y
and the columns of z
.
For convenience, the matrix can supplied as the x
argument. Or, x
can be a list with elements including {x, y, z, xlab, ylab, zlab}.
When this function is used inside a higher-level plotting function, the arguments xds
, yds
, and zds
should be set to deparse(substitute(x))
(etc.) so that the function can generate informative default axis labels. For example, see the code for colorgram
.
# NOT RUN {
##
str(volcano)
volcano.xyzmat <- xyzmat.coords(volcano)
str(volcano.xyzmat)
# }
Run the code above in your browser using DataLab