Description Usage Arguments Author(s) See Also Examples
Adds stems to a three dimensional plot previously created by
plot3d()
or persp()
. Three-dimensional stem plots
display lines extending from the xy-plane (by default). A plot symbol
represents the z value at the end of each stem.
1 2 3 4 |
x |
the coordinates of points in the plot. Alternatively, a single plotting structure, function or any R object with a plot method can be provided. |
y |
the y coordinates of points in the plot, optional if
|
z |
the z coordinates of points in the plot, optional if
|
persp.matrix |
an 4-by-4 transformation matrix describing how
to project the (x,y,z) points to the drawing canvas as the one
returned by |
. Default value is
getOption("persp.matrix")
, which is set by plot3d()
.
plane |
Plane from which the stems are originating. Possible planes are xy, xz and yz. If the letters are reversed, e.g. yx, the stem will originate from the oposite side of the 3d cube. |
cex |
the character expansion of the data points. Default is
|
col |
the color of the data points.
Default value is |
pch |
plotting "character", i.e. symbol to use. For more
information see |
depthOrder |
If |
... |
further arguments accepted by |
Henrik Bengtsson
For creating a 3D plot see plot3d
().
For adding lines to a 3D plot see lines3d
().
For adding points to a 3D plot see points3d
().
For adding text to a 3D plot see text3d
().
For adding polygons to a 3D plot see polygon3d
().
For adding stems to a 3D plot see stem3d
().
See also persp
.
Package scatterplot3d
by Uwe Ligges.
For detail about the graphical parameter arguments,
see par
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | x <- seq(0,2, length.out=20)
y <- x / 2
z <- sin(x) + cos(y)
layout(matrix(1:4, nrow=2, byrow=TRUE))
plot3d(x,y,z, type="n", theta=-25, phi=30) # empty 3d plot
stem3d(x,y,z, col="blue", pch=1, cex=1.5)
plot3d(x,y,z, type="n", theta=-25, phi=30) # empty 3d plot
stem3d(x,y,z, col="red", pch=1, cex=1.5, plane="xz")
plot3d(x,y,z, type="n", theta=-25, phi=30) # empty 3d plot
stem3d(x,y,z, col="green", pch=1, cex=1.5, plane="yz")
plot3d(x,y,z, type="n", theta=-25, phi=30) # empty 3d plot
stem3d(x,y,z, col="cyan", pch=".", cex=1.5, plane="xy")
stem3d(x,y,z, col="orange", pch=".", cex=1.5, plane="zx")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.