Vectors with x, y and t-values.
Their position in the z-array depends on tdim.
z
Three-dimensional array with the z-values to be plotted.
tdim
Index to where the time variable (over which the plot will loop)
is to be found in z and colvar. The default is the first position,
so that z and colvar are of dimension (length(t), length(x), (length(y).
colvar
The variable used for coloring.
It should be an array of dimension equal to the dimension of z.
It need not be present.
col
Colors to be used for coloring the colvar variable.
If col is NULL
then a red-yellow-blue colorscheme (jet.col) will be used.
NAcol
Colors to be used for colvar values that are NA.
breaks
A set of finite numeric breakpoints for the colors;
must have one more breakpoint than color and be in increasing order.
Unsorted vectors will be sorted, with a warning.
colkey
A logical, NULL (default), or a list with parameters
for the color key (legend).
If colkey = NULL then a color key will be added only if col is a vector.
Setting colkey = list(plot = FALSE) will create room for the color key
without drawing it.
if colkey = FALSE, no color key legend will be added.
clim
Only if colvar is specified, the range of the color variable values.
Values of colvar that extend the range will be put to NA and colored
as specified with NAcol.
clab
Only if colkey is not NULL or FALSE,
the label to be written on top of the color key.
The label will be written at the same level as the main title.
To lower it, clab can be made a vector, with the first values empty
strings.
add
Logical. If TRUE, then the slices will be added to the current plot.
If FALSE a new plot is started.
ask
Logical. If TRUE, then the new slice will only be drawn after a key has been struck. If FALSE, redrawing will depend on wait
wait
The time interval inbetween drawing of a new slice, in seconds.
If NULL, the drawing will not be suspended.
basename
The base name of a png file to be produced for each movieframe.
...
additional arguments passed to persp3Drgl from package
plot3Drgl.
Value
returns nothing
Author(s)
Karline Soetaert <karline.soetaert@nioz.nl>
See Also
Sylt3D for a data set that can be displayed with moviepersp3D
moviepoints3D for plotting moving points in 3D
movieslice3D for plotting moving slices in 3D
Examples
x <- y <- t <- seq(-1, 1, by = 0.1)
grid <- mesh(x, y, t)
z <- with(grid, x*exp(-x^2 - y^2 - z^2))
moviepersp3D (x, y, z = z, colvar = z, colkey = TRUE,
ticktype = "detailed", wait = 0.1, main = "t = ")
## Not run:
moviepersp3D (x, y, z = z, colvar = z, colkey = TRUE,
aspect = TRUE, bty = "n", ask = FALSE, main = "t = ")
## End(Not run)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(OceanView)
Loading required package: plot3D
Loading required package: plot3Drgl
Loading required package: rgl
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/OceanView/moviepersp.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Moving surfaces in 3D
> ### Title: Plotting moving surfaces in 3D using rgl
> ### Aliases: moviepersp3D
> ### Keywords: hplot
>
> ### ** Examples
>
> x <- y <- t <- seq(-1, 1, by = 0.1)
> grid <- mesh(x, y, t)
> z <- with(grid, x*exp(-x^2 - y^2 - z^2))
>
> moviepersp3D (x, y, z = z, colvar = z, colkey = TRUE,
+ ticktype = "detailed", wait = 0.1, main = "t = ")
>
> ## Not run:
> ##D moviepersp3D (x, y, z = z, colvar = z, colkey = TRUE,
> ##D aspect = TRUE, bty = "n", ask = FALSE, main = "t = ")
> ## End(Not run)
>
>
>
>
>
>
> dev.off()
null device
1
>