I am supposed to do 3d barplot and I found this peace of code where I added axis labels. I get the following plot:
The problem is that the axis tick mark labels and axis labels overlap. How can we prevent that?
The code is:
library(plot3D)
data(VADeaths)
hist3D (x = 1:5, y = 1:4, z = VADeaths,
bty = "g", phi = 20, theta = -60,
xlab = "My_x_lab", ylab = "My_y_lab", zlab = "", main = "VADeaths",
col = "#0072B2", border = "black", shade = 0.8,
ticktype = "detailed", space = 0.15, 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)
# Use text3D to label y axis
text3D(x = rep(1, 4), y = 1:4, z = rep(0, 4),
labels = colnames(VADeaths),
add = TRUE, adj = 1)
