The variable used for coloring the image plot, or containing the
values to be plotted for the contour plot.
x0, y0
coordinates of points from which to draw the arrows.
x1, y1
coordinates of points to which to draw the arrows.
At least one must be supplied.
colvar
The variable used for coloring the scatter plot or the arrows.
If NULL, then col will be used as such.
labels
The text to be written. A vector of length equal to length of
x, y.
col
Color palette to be used for the z or colvar variable.
If colvar is NULL, then the colors are used as such.
NAcol
Color to be used for NA values; default is “white”.
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.
border
The color of the lines drawn around the surface facets.
The default, NA, will disable the drawing of borders.
facets
If TRUE, then col denotes the color of the surface facets.
If FALSE, then the surface facets are colored “white” and the border
will be colored as specified by col. If NA then the facets will be
transparent.
shade
the degree of shading of the surface facets.
Values of shade close to one yield shading similar to a point light
source model and values close to zero produce no shading.
Creates the illusion of perspective.
See persp.
contour
If TRUE, then a contour plot will be
added to the image plot.
Also allowed is to pass a list with arguments for the
contour2D function.
smooth
Logical, specifying whether Gouraud shading (smooth)
or flat shading should be used. (if TRUE then function
cutrgl will not work).
colkey
A logical, NULL (default), or a list with parameters for the
color key (legend). Not all arguments from the original colkey function
from plot3D are supported. For instance, color keys will always be
put on the 4th margin.
clim
Only if colvar is specified, the range of the color variable used.
Values of colvar that extend the range will be put to NA.
clab
Only if colkey = TRUE, 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.
inttype
The interpolation type to create the polygons, either
interpolating the z (inttype = 1 or the x, y
values (inttype = 2) - see persp3D.
CI
A list with parameters and values for the confidence
intervals or NULL.
If a list it should contain at least the item x or y.
Other parameters should be one of (with defaults):
alen = 0.01, lty = par("lty"), lwd = par("lwd"), col = NULL,
to set the length of the arrow head, the line type and width, and the color.
If col is NULL, then the colors of the scatter points are used.
type
The type of the arrow head, one of "simple"
(the default, which uses R-function arrows) or
"triangle".
dz
The 'layer depth', The z-position is defined as 1 + dz.
add
Logical. If TRUE, then the image, contour or points will be
added to the current plot.
If FALSE a new plot is started.
...
additional arguments passed to the plotting methods.
The following persp arguments can be specified:
xlim, ylim, zlim, xlab, ylab, zlab, main, sub, r, d,
scale, expand, box, axes, nticks, ticktype, shade, ltheta, lphi.
In addition, the perspbox arguments
col.axis, col.panel, lwd.panel, col.grid, lwd.grid can
also be given a value.
Also the arguments lty, lwd can be specified.
The arguments after ... must be matched exactly.
Details
The first step in 2D rgl plotting consists in calling a 3-D function from package plot3D
with argument plot set to FALSE.
image2Drgl and contour2Drgl call the image3D and contour3D
functions of R-package plot3D, with colvar equal to z.
Functions scatter2Drgl and arrows2Drgl call scatter3D and arrows3D.
The z value argument to the 3-D functions is set equal to 1 + dz;
For contour3D, scatter3D and arrows3D, it is by default equal to 1.1,
while for image3D it is 1.
This way, contours, points, segments and arrows will be drawn on top of the image.
The next step is to create a 3-D rgl plot, by calling plotrgl.
After that, the viewing arguments are set equal to
view3d(phi = 0, fov = 0), i.e. the plot is viewed at from the top.
The actions of the mouse on the plots is to zoom (left, middle), and to move it (right key).
Author(s)
Karline Soetaert <karline.soetaert@nioz.nl>
See Also
image3D, contour3D, scatter3D, segments3D,
text3D and arrows3D
on which the functions are based.
image2D, contour2D, scatter2D, segments2D,
text2D, arrows2D
for plot3D's functions, to plot in ordinary R graphics.
cutrgl for cutting a rectangular region from the 2D plot.