Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中使用plot3d删除轴记号_R_Plot_3d_Rgl - Fatal编程技术网

在R中使用plot3d删除轴记号

在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

我试图渲染一个内部绘制有球体的三维立方体。 我在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)
我已尝试添加
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()