These functions produce three dimensional plots in each panel (as long
as the default panel functions are used). The orientation is obtained
as follows: the data are scaled to fall within a bounding box that is
contained in the [-0.5, 0.5] cube (even smaller for non-default values
of aspect
). The viewing direction is given by a sequence of
rotations specified by the screen
argument, starting from the
positive Z-axis. The viewing point (camera) is located at a distance
of 1/distance
from the origin. If perspective=FALSE
,
distance
is set to 0 (i.e., the viewing point is at an infinite
distance). cloud
draws a 3-D Scatter Plot, while wireframe
draws a
3-D surface (usually evaluated on a grid). Multiple surfaces can be
drawn by wireframe
using the groups
argument (although
this is of limited use because the display is incorrect when the
surfaces intersect). Specifying groups
with cloud
results in a panel.superpose
-like effect (via
panel.3dscatter
).
wireframe
can optionally render the surface as being
illuminated by a light source (no shadows though). Details can be
found in the help page for panel.3dwire
. Note that
although arguments controlling these are actually arguments for the
panel function, they can be supplied to cloud
and
wireframe
directly.
For single panel plots, wireframe
can also plot parametrized
3-D surfaces (i.e., functions of the form f(u,v) = (x(u,v), y(u,v),
z(u,v)), where values of (u,v) lie on a rectangle. The simplest
example of this sort of surface is a sphere parametrized by latitude
and longitude. This can be achieved by calling wireframe
with a
formula
of the form z~x*y
, where x
, y
and
z
are all matrices of the same dimension, representing the
values of x(u,v), y(u,v) and z(u,v) evaluated on a discrete
rectangular grid (the actual values of (u,v) are irrelevant).
When this feature is used, the heights used to calculate drape
colors or shading colors are no longer the z
values, but the
distances of (x,y,z)
from the origin.
Note that this feature does not work with groups
,
subscripts
, subset
, etc. Conditioning variables are also
not supported in this case.
The algorithm for identifying which edges of the bounding box are
`behind' the points doesn't work in some extreme situations. Also,
panel.cloud
tries to figure out the optimal location of the
arrows and axis labels automatically, but can fail on occasion
(especially when the view is from ``below'' the data). This can be
manually controlled by the scpos
argument in
panel.cloud
.
These and all other high level Trellis functions have several other
arguments in common. These are extensively documented only in the
help page for xyplot
, which should be consulted to learn more
detailed usage.