plot.twApply3DMesh: plot twApply3DMesh

Description Usage Arguments Details Author(s) Examples

Description

Creates an rgl scene with contours from calculated mesh.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'twApply3DMesh'
plot(x, probs = NULL, levels = NULL, xlab = NULL, 


    ylab = NULL, zlab = NULL, sample = x$sample, nDrawPoints = if (0 < 


        length(sample)) nrow(sample) else 200, col = rev(heat.colors(100)), 


    alo = 0.1, ahi = 0.5, cmap = heat.colors, box = TRUE, axes = TRUE, 


    xlim = NULL, ylim = NULL, zlim = NULL, ...)

Arguments

x

results of twApply3DMesh

probs

numeric vector: levels will be calculated with quantiles of the results of the sample

levels

numeric vector: values of FUN return values where contour surface should be drawn

xlab

labels, default to variable names or column names in x

ylab
zlab
sample

dataframe of four columns: sample points to draw

nDrawPoints

number of points in xyz to draw. Set to 0 if no points should be drawn

col

colour of the points

alo

minimum and maximum transparency for contour levels

ahi
cmap
box

whether to draw box and axes

axes
xlim
ylim
zlim
...

further arguments to plot3d

Details

Further plotting Functionality of package twMiscRgl
  • 3D scatter and contour plots: this method

If argument level is supplied, the argument probs is ignored.

Together with a small nDrawPoints this saves calculation time.

If a sample was provided the quantiles of surface levels are calculated from

the sample, otherwise from the mesh x.

Author(s)

Thomas Wutzler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#Example: Nested contours of mixture of three tri-variate normal densities


nmix3 <- function(x, y, z, m, s) {


	0.4 * dnorm(x, m, s) * dnorm(y, m, s) * dnorm(z, m, s) +


		0.3 * dnorm(x, -m, s) * dnorm(y, -m, s) * dnorm(z, -m, s) +


		0.3 * dnorm(x, m, s) * dnorm(y, -1.5 * m, s) * dnorm(z, m, s)


}


f <- function(x,y,z) nmix3(x,y,z,.5,.5)





n <- 250


x <- rnorm(n,.5,.5)


y <- c(rnorm(n/2,.5,.5), rnorm(n/2,-.5,.5)) 


zz <- rnorm(n,.5,.5)





plot(tmp <- twApply3DMesh(x,y,zz,f, nSample=200, dims=10))	# just the points


#mtrace(plot.twApply3DMesh)


plot( tmp, col=rev(heat.colors(22))[-(1:5)]) # avoiding near white colors


plot( tmp, levels=seq(0.05, 0.14, len=3) )	# specifying contour levels directly at function value scale 


plot( tmp, probs=seq(0.5, 0.95, len=4), nDrawPoints=0)		# specifying quantiles of FUN results

twMiscRgl documentation built on May 2, 2019, 4:14 p.m.