I am creating a 3D scatter plot using the scatter3D function from the plot3D library. My problem is that I can not set the margins around the plot. More specifically I need more space at the bottom. I used both the arguments mai and mar suggested in the documentation but they have no effect. My code is the following:
library(plot3D)
C <- c(-1, 1, -1, 1, -1, 1, -1, 1)
T <- c(-1, -1, 1, 1, -1, -1, 1, 1)
S <- c(-1, -1, -1, -1, 1, 1, 1, 1)
O <- c(5, 30, 6, 33, 4, 3, 5, 4)
scatter3D(x = C, y = T, z = S, col = "red", phi = 0, cex = O, bty = "g", alpha = 0.5 , pch = 20, nticks = 5,
xlab = "Chemical", ylab = "Temperature", zlab = "Speed", main = "Experiment with 3 Factors",
ticktype= "detailed", mai = c(1, 0.1, 0.1, 0.1) , mar = c(10, 4, 4, 2) + 0.1)
You can view the margins of your plot window as follows:
par()$oma
par()$mar
You can set the to zero as:
par(mar = c(0,0,0,0))
par(oma = c(0,0,0,0))
Although I think you are looking for:
par(xpd=TRUE)
which allows you to draw outside of the plot area.
Hope this helps!