Search code examples
r3dlabelscatter-plotplot3d

Telling scatter3D from plot3D library to plot the tick labels


I am doing a 3D scatter plot using the scatter3D function of the plot3D library but I can not find the way to give the syntax so that the plot contains the tick labels.

My code is the following:

library(plot3D)
A <- c(0, 1, 0, 1)
B <- c(0, 0, 1, 1)
y <- c(52, 74, 62, 80)
scatter3D(x = A, y = B, z = y,  col = "red", phi = 0, cex = 2, bty = "g", alpha = 0.5 , pch = 20, nticks = 10,
          xlab = "Time Factor", ylab = "Corn Factor", zlab = "Outcome", main = "Experiment with 2 Factors")

enter image description here


Solution

  • In the documentation, there is a mention of the argument:

    ...    arguments to be passed down
    

    These are passed down to persp. There it is stated that ticktype is defaulted to 'simple', but can be altered to 'detailed'. So adding the argument

    ticktype= "detailed"
    

    should work. Hope this helps!