batchPlot.3d: Plot 3D Data

Description Usage Arguments Examples

Description

The list x contains, in turn, lists which have the elements x, y, z, each of which represent one dataset to be plotted.

Usage

1
2
3
batchPlot.3d(data, plotPoints = TRUE, model = .model,
  predict = .predict, modelSteps = 20, legend = NULL,
  legendWidth = 0.3, ...)

Arguments

data

the data list, a list of lists where each element is a list with elements x, y, z, which must be vectors.

plotPoints

should the raw points be plotted?

model

a function(data) receiving one item from the data list, which i sued for modeling the data, or NULL, by default a Kriging-based modeling if no modeling is necessary

predict

a function(model, x, y) for predicting z coordinates based on models, or NULL if no modeling is necessary; by default a Kriging-based predictor

modelSteps

the number of steps for modeling along each axis

legend

the legend

legendWidth

the fraction of the plot to be allocated for the legend

...

Arguments passed on to scatterplot3d::scatterplot3d

color

colors of points in the plot, optional if x is an appropriate structure. Will be ignored if highlight.3d = TRUE.

pch

plotting "character", i.e. symbol to use.

main

an overall title for the plot.

sub

sub-title.

xlim

the x, y and z limits (min, max) of the plot. Note that setting enlarged limits may not work as exactly as expected (a known but unfixed bug).

ylim

the x, y and z limits (min, max) of the plot. Note that setting enlarged limits may not work as exactly as expected (a known but unfixed bug).

zlim

the x, y and z limits (min, max) of the plot. Note that setting enlarged limits may not work as exactly as expected (a known but unfixed bug).

xlab

titles for the x, y and z axis.

ylab

titles for the x, y and z axis.

zlab

titles for the x, y and z axis.

scale.y

scale of y axis related to x- and z axis.

angle

angle between x and y axis (Attention: result depends on scaling).

axis

a logical value indicating whether axes should be drawn on the plot.

tick.marks

a logical value indicating whether tick marks should be drawn on the plot (only if axis = TRUE).

label.tick.marks

a logical value indicating whether tick marks should be labeled on the plot (only if axis = TRUE and tick.marks = TRUE).

x.ticklabs

vector of tick mark labels.

y.ticklabs

vector of tick mark labels.

z.ticklabs

vector of tick mark labels.

y.margin.add

add additional space between tick mark labels and axis label of the y axis

grid

a logical value indicating whether a grid should be drawn on the plot.

box

a logical value indicating whether a box should be drawn around the plot.

lab

a numerical vector of the form c(x, y, len). The values of x and y give the (approximate) number of tickmarks on the x and y axes.

lab.z

the same as lab, but for z axis.

highlight.3d

points will be drawn in different colors related to y coordinates (only if type = "p" or type = "h", else color will be used).
On some devices not all colors can be displayed. In this case try the postscript device or use highlight.3d = FALSE.

mar

A numerical vector of the form c(bottom, left, top, right) which gives the lines of margin to be specified on the four sides of the plot. See section Values on how to change the setting back to the default / previous setting.

bg

background (fill) color for the open plot symbols given by pch = 21:25.

col.axis

the color to be used for axis / grid / axis labels.

col.grid

the color to be used for axis / grid / axis labels.

col.lab

the color to be used for axis / grid / axis labels.

cex.symbols

the magnification to be used for point symbols, axis annotation, labels relative to the current.

cex.axis

the magnification to be used for point symbols, axis annotation, labels relative to the current.

cex.lab

the magnification to be used for point symbols, axis annotation, labels relative to the current.

font.axis

the font to be used for axis annotation / labels.

font.lab

the font to be used for axis annotation / labels.

lty.axis

the line type to be used for axis / grid.

lty.grid

the line type to be used for axis / grid.

lty.hide

line style used to plot ‘non-visible’ edges (defaults of the lty.axis style)

lty.hplot

the line type to be used for vertical segments with type = "h".

log

Not yet implemented! A character string which contains "x" (if the x axis is to be logarithmic), "y", "z", "xy", "xz", "yz", "xyz".

asp

numeric, giving the aspect ratio z/x or z/y, see ‘Note’.

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
library(plotteR)

# set a random seed for replicability
set.seed(1000L);

# generate the first example dataset
f1 <- function(x, y) (x*x - y*y);
x1 <- runif(n=400, min=-2, max=2);
y1 <- runif(n=400, min=-2, max=2);
z1 <- f1(x1, y1);
d1 <- list(x=x1, y=y1, z=z1);

# generate the second example dataset
f2 <- function(x, y) 0.8*x + 0.25*y - 7;
x2 <- runif(n=400, min=-2, max=2);
y2 <- runif(n=400, min=-2, max=2);
# here we even add a bit of randomness into the data
z2 <- rnorm(n=400, mean=f2(x2, y2), sd=0.3);
d2 <- list(x=x2, y=y2, z=z2);

# plot the data together with the interpolated surfaces
batchPlot.3d(list(d1, d2), plotPoints=TRUE, legend=c("f1", "f2"), legendWidth=0.1);

readline("Press return to continue");

# now we just plot the actual surfaces for comparison.
d1$f <- f1;
d2$f <- f2;
batchPlot.3d(list(d1, d2), plotPoints=FALSE, legend=c("f1", "f2"),
             model=function(d) d$f,
             predict=function(m, x, y) m(x, y), legendWidth=0.1);

thomasWeise/plotteR documentation built on May 29, 2019, 5:41 a.m.