2017-08-07 46 views
0

我正在尝试创建一个行星组的3D散点图,每个物体都被正确标记。下一个代码创建我需要的绘图。如何格式化car :: scatter3d中的点的标签?

with(bpmg, { 
    car::scatter3d(x = X, y = Y,z = Z, 
       surface = FALSE, 
       point.col = color, 
       labels = Name, 
       id.n = nrow(bpmg)) 
}) 

enter image description here

我不能在documentation找到,然而,这是一种格式化每个行星的标签,以这样一种方式,他们没有这样的尺寸和/或颜色。有什么我可以做的吗?

回答

1

我不知道scatter3d功能,但如果您使用rglplot3dtext3d它是相当简单的。例如,

with(bpmg, { 
    rgl::plot3d(x = X, y = Y,z = Z, col = color) 
    rgl::text3d(x = X, y = Y, z = Z, col = othercolor, adj = c(0,0), 
       cex = 2) 
}) 

这是未经测试的(您没有在您的问题中包含任何数据)。