繁体   English   中英

替代spline for scatterplot3d?

[英]Alternative to abline for scatterplot3d?

3D散点图有'替换'的替代方案吗? 我正在使用'scatterplot3d'包。

图像中的蓝线是我想要做的。 如果我添加'曲面',它将阻止原始曲线。

在此输入图像描述

像这样的东西?

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)

基本思想是捕获sactterplot3d(...)返回的对象。 这是一个列表,其中一个元素是一个函数, points3d(...)可以将点(或type="l" )添加到现有的图中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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