Description Usage Arguments Value Author(s) See Also Examples
View source: R/ellipse3d.axes.R
A function to draw the major axes of a 3D ellipsoid from a correlation, covariance or sums of squares and cross products matrix.
1 2 3 |
x |
A square positive definite matrix at least 3x3 in size. It will be treated as the correlation or covariance of a multivariate normal distribution. |
centre |
The center of the ellipse |
scale |
If x is a correlation matrix, then the standard deviations of each parameter can be given in the scale parameter.
This defaults to |
level |
The confidence level of a simulataneous confidence region. The default is 0.95, for a 95% region. This is used to control the size of the ellipsoid. |
t |
The size of the ellipsoid may also be controlled by specifying the value of a t-statistic on its boundary. |
which |
This parameter selects which variables from the object will be plotted. The default is the first 3. |
labels |
Either a logical value, a character string, or a character vector of length 3.
If |
label.ends |
A vector of lengeth 3 indicating which ends of the axes should
be labeled, corresponding to a selection of rows of the 6 x 3 matrix of axes
end points. Default: |
... |
Other arguments passed to |
Returns a 6 x 3 matrix containing the end points of the three axis lines in pairs by rows.
Michael Friendly
1 2 3 4 5 6 7 8 9 10 11 | data(iris)
iris3 <- iris[,1:3]
cov <- cov(iris3)
mu <- colMeans(iris3)
col <-c("blue", "green", "red")[iris$Species]
library(rgl)
plot3d(iris3, type="s", size=0.4, col=col, cex=2, box=FALSE, aspect="iso")
plot3d( ellipse3d(cov, centre=mu, level=0.68), col="gray", alpha=0.2, add = TRUE)
axes <- ellipse3d.axes(cov, centre=mu, level=0.68, color="gray", lwd=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.