No, I mean in plot3d(): plot3d(trees, type="s", size=0.5, col="blue", cex=2, box=FALSE, axes=FALSE)
not in ellipse3d() Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Wed, Sep 17, 2008 at 9:40 PM, Michael Friendly <[EMAIL PROTECTED]> wrote: > Yihui Xie wrote: >> >> Hi Michael, >> >> You need to specify both 'box' and 'axes' to FALSE to avoid the box >> lines (if you don't specify the latter one, there will still be axes >> lines). >> >> >> > > Hi Yihui > I tried several variations, none of which would simply add the ellipse and > nothing else to the original > plot of points: > > plot3d(trees, type="s", size=0.5, col="blue", cex=2) > > # how to avoid the extra box? > # -- this doesn't remove the extra box, but keeps the points & axis labels > plot3d( ellipse3d(cov, centre=mu, level=0.68, box=FALSE), col="pink", > alpha=0.2, add = TRUE, axes=FALSE) > > # -- this removes the original axes, the points & labels axes x, y, z > plot3d( ellipse3d(cov, centre=mu, level=0.68, box=FALSE, col="pink", > alpha=0.2, add = TRUE, axes=FALSE)) > > -Michael >> >> On Wed, Sep 17, 2008 at 8:34 PM, Michael Friendly <[EMAIL PROTECTED]> >> wrote: >> >>> >>> Hi >>> I'm trying to make a 3d plot showing a point cloud, the corresponding >>> data >>> ellipse >>> and the principal axes of the ellipse as vectors. >>> >>> library(rgl) >>> data(trees) >>> cov <- cov(trees) >>> mu <- mean(trees) >>> >>> plot3d(trees, type="s", size=0.5, col="blue", cex=2) >>> >>> In this step, an extra box is added. I've tried using box=FALSE, but it >>> has >>> no effect. >>> # how to avoid the extra box? >>> plot3d( ellipse3d(cov, centre=mu, level=0.68), col="pink", alpha=0.2, >>> add = >>> TRUE) >>> >>> Here's what I've tried to plot the principal axes in variable space, >>> using >>> the result of prcomp(). >>> But I've got something wrong, because, although they are at right angles, >>> they don't >>> align with the ellipse. >>> >>> PC <- princomp(trees) >>> sdev <- PC$sdev # component standard deviations >>> sd <- sqrt(diag(cov)) # variable standard deviations >>> >>> # vectors in variable space of principal components >>> vec <- matrix(mu,3,3, byrow=TRUE) + diag(sd) %*% PC$loadings >>> >>> for (j in 1:3) { >>> mat <- rbind(mu, vec[j,]) >>> segments3d(mat, col="red") >>> } >>> >>> Can someone help? >>> > > -- > Michael Friendly Email: friendly AT yorku DOT ca Professor, Psychology > Dept. > York University Voice: 416 736-5115 x66249 Fax: 416 736-5814 > 4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html > Toronto, ONT M3J 1P3 CANADA > > > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.