Description Usage Arguments Author(s) See Also Examples
Creating an image or contour plot of a three-dimensional array.
1 2 3 4 |
x |
locations of grid lines at which the values in z are measured. These must be in ascending order. By default, equally spaced values from 0 to 1 are used. If x is a list, its components x$x and x$y are used for x and y, respectively. If the list has component z this is used for z. |
y |
|
z |
a matrix containing the values to be plotted (NAs are allowed). Note that x can be used instead of z for convenience. |
xlab |
labels, default to variable names or column names in x |
ylab |
|
zlab |
|
key.title |
see |
key.axes |
|
axes |
|
las |
|
contour |
if TRUE then |
col |
colors for using image |
... |
further arguments passed to |
Thomas Wutzler
twPairs
, twMisc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | nmix3 <- function(x, y, m, s) {
0.4 * dnorm(x, m, s) * dnorm(y, m, s) +
0.3 * dnorm(x, -m, s) * dnorm(y, -m, s) +
0.3 * dnorm(x, m, s) * dnorm(y, -1.5 * m, s)
}
f <- function(x,y) nmix3(x,y,.5,.5)
n <- 30
x <- sort(rnorm(n,.5,.7))
y <- sort(rnorm(n,.5,.8))
#mtrace(twApply2DMesh)
#mtrace(twPlot2DFun)
tmp <- twApply2DMesh(x,y,f,knotSpacing="all")
#plot(tmp)
twPlot2D( tmp$mesh,z=tmp$fval,zlab="density")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.