在R中使用plot3d删除轴记号
我试图渲染一个内部绘制有球体的三维立方体。 我在R中使用RGL库并使用plot3d进行渲染 我想保留所有12条轴线,但删除记号 这是我的代码:在R中使用plot3d删除轴记号,r,plot,3d,rgl,R,Plot,3d,Rgl,我试图渲染一个内部绘制有球体的三维立方体。 我在R中使用RGL库并使用plot3d进行渲染 我想保留所有12条轴线,但删除记号 这是我的代码: library(rgl) rgl.open() rgl.bg(color='white') a <- c(0.9, 0.9, 0.1) b <- c(0.1, 0.9, 0.9) c <- c(0.9, 0.1, 0.1) xlab="z" ylab="y" zlab="x" type="s" col="red" size=3
library(rgl)
rgl.open()
rgl.bg(color='white')
a <- c(0.9, 0.9, 0.1)
b <- c(0.1, 0.9, 0.9)
c <- c(0.9, 0.1, 0.1)
xlab="z"
ylab="y"
zlab="x"
type="s"
col="red"
size=3
plot3d(a, b, c, xlab, ylab, zlab, type, col, size, xlim=c(0,1), ylim=c(0,1), zlim=c(0,1), aspect=c(3,3,3), main="", sub="", ann=FALSE, axes=TRUE)
我已尝试添加alpha
argue,但这是输出(其中之一):
欢迎您的任何意见。这个看似简单的问题引起了相当大的争议
TLDR:如何制作带有标记的点和xyz轴的透明立方体。(没有滴答声)
R版本:3.5.1
平台:x86_64-apple-darwin15.6.0(64位)
p.S.无法为plot3d创建新标记。。因此它们是分开的…这与您的问题无关,但重要的是:不要使用
rgl.open()
或rgl.bg()
或rgl.bbox()
。他们只会给你带来麻烦。使用open3d()
和bg3d()
和bbox3d()
也不相关,但我认为这是一个很好的建议:不要在没有命名参数的情况下使用具有长参数列表的函数。让未命名的arg与错误的对象匹配太容易了
至于你的问题:做没有轴的绘图,然后添加你想要的非标准轴。因为您实际上不需要任何东西,所以只需使用box3d()
来绘制框。比如说,
library(rgl)
open3d()
bg3d(color = "white")
a <- c(0.9, 0.9, 0.1)
b <- c(0.1, 0.9, 0.9)
c <- c(0.9, 0.1, 0.1)
xlab <-"z"
ylab <- "y"
zlab <- "x"
type <- "s"
col <- "red"
size <- 10
plot3d(a, b, c,
xlab = xlab, ylab = ylab, zlab = zlab,
type = type, col = col,
xlim = c(0,1), ylim = c(0,1), zlim = c(0,1),
aspect = c(3,3,3),
size = size,
main = "", sub = "", ann = FALSE, axes = FALSE)
box3d()
库(rgl)
open3d()
bg3d(颜色=“白色”)
A.
library(rgl)
open3d()
bg3d(color = "white")
a <- c(0.9, 0.9, 0.1)
b <- c(0.1, 0.9, 0.9)
c <- c(0.9, 0.1, 0.1)
xlab <-"z"
ylab <- "y"
zlab <- "x"
type <- "s"
col <- "red"
size <- 10
plot3d(a, b, c,
xlab = xlab, ylab = ylab, zlab = zlab,
type = type, col = col,
xlim = c(0,1), ylim = c(0,1), zlim = c(0,1),
aspect = c(3,3,3),
size = size,
main = "", sub = "", ann = FALSE, axes = FALSE)
box3d()