简体   繁体   中英

Alternative to abline for scatterplot3d?

Is there an alternative to 'abline' for 3D scatterplot? I'm using 'scatterplot3d' package.

The blue line in the image is what I want to do. If I add a 'surface', then it will block the original plot.

在此输入图像描述

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM