2017-08-07 50 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) 
}) 

這是未經測試的(您沒有在您的問題中包含任何數據)。