Something like this?
th <- seq(0,8*pi,len=100)
r <- seq(0,1,len=100)
x <- r*cos(th)
y <- r*sin(th)
z <- 10*r
library(scatterplot3d)
plt <- scatterplot3d(x,y,z, type="l")
plt$points3d(x=c(-1,1,1,-1,-1), y=c(1,1,-1,-1,1),z=rep(5,5), type="l", col="blue", lwd=2)
The basic idea is to capture the object returned by sactterplot3d(...)
. This is a list, one element of which is a function, points3d(...)
which can add points (or lines with type="l"
) to the existing plot.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.