I have a three-dimensional scatter chart created as follows:
library(rgl) N <- 10000 X <- rnorm(N,0,1) Y <- rnorm(N,0,1) Z <- X * Y want <- Z >0 & X>0 palette <- colorRampPalette(c("blue", "green", "yellow", "red")) col.table <- palette(256) col.index <- cut(Z, 256) plot3d(X,Y,Z, col=col.table[col.index]) grid3d(c("x", "y", "z"))
It works great. Now I want to overlay another plot, so I tried this:
par(new=F) plot3d(X[want],Y[want],Z[want], col="black")
However, this fails - he simply rewrites the old plot. Is there a way to overlay a new plot?
source share