R,旋转3D直方图,但轴不旋转

时间:2019-06-03 13:57:51

标签: r 3d histogram

为简化起见,我使用以下代码。很好。

library(plot3D)

hist3D(x = 1:5, y = 1:4, z = VADeaths,
    bty = "b2", phi = 20,  theta = -65,
    xlab = "", ylab = "", zlab = "deaths / 1000",
    col = "#56B4E9", border = "#01587A", 
    shade = 0.2,
    ticktype = "detailed", space = .3, d = 2,
    cex.axis = 1e-9
)

# Use text3D to label x axis
    text3D(x = 1:5, y = rep(0.5, 5), z = rep(3, 5),
    labels = rownames(VADeaths),
    add = TRUE, adj = -0.2)

# Use text3D to label y axis
text3D(x = rep(0, 3), y = rep(5, 3), z = 20*(1:3),
    labels  = 20*(1:3),
    add = TRUE, adj = -1.2)

# Use text3D to label z axis
text3D(x = rep(1, 4), y = 1:4, z = rep(0, 4),
    labels  = colnames(VADeaths),
    add = TRUE, adj = 1)

如果我们使用例如theta = 100旋转输出,则轴上的文本不会跟随该旋转。

scramble axis

如何将文本放在正确的位置?

0 个答案:

没有答案