在 R 中使用 plot3d 删除坐标轴刻度

Remove axes ticks using plot3d in R

我正在尝试渲染一个内部绘制有球体的 3D 立方体。 我在 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

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)

输出:

我试过使用这个 POST 作为解决方案,但我无法让轴线出现,同时确保立方体是透明的。

下面的代码基于上述 post:

plot3d(xvar, yvar, zvar, type = 's', col = colgroup, size = 0.05, alpha = 0.50, 
       radius = 0.2, xlab = 'Cost Leader', ylab = 'Performance Leader', 
       zlab = 'Fashion Leader', axes = FALSE)
rgl.bbox(xlen = 0, ylen = 0, zlen = 0, color = c('grey100'), alpha=0.5, axes=TRUE)
text3d(x = xvar, y = yvar, z = zvar, text = brands, adj = c(2.5,2.5), cex = 0.7)

我尝试添加 alpha 论点,但这是输出(其中之一):

欢迎任何意见。这个看似简单的问题却引起了相当大的麻烦。

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().

也无关,但我认为这是一个很好的建议:不要在没有命名参数的情况下使用带有长参数列表的函数。将未命名的参数与错误的东西匹配太容易了。

关于你的问题:画无轴的图,然后添加你想要的非标准轴。由于您真的不需要那里的任何东西,因此只需使用 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()

这会产生