Plot3d - how to change box color and remove axis ticks

I am trying to make some visual changes to the default plot3d object. Specifically, I would like to place a light square as the background (only in the box, not the entire palette) and remove the axis type labels (the x, y, z values ​​on the axis are distracting). I have spent countless hours looking for which options to change, but I can’t figure it out for my life. Any help would be greatly appreciated.

I have shortened my code to the following so you can re-create it.

library(rgl)

xvar <- c(0.23158792, 0.09686823, -0.58937138, -1.04380419,0.52169760, 1.15218492, 1.36873947,
      -0.91592078, -0.66918513, -0.15279666)
yvar <- c(-1.06993703, 1.51913070 , 1.45069457, -0.78186861, -0.05373430, 0.45442899, 0.04408369,
      -0.31418560, -0.20741901, -1.04119340)
zvar <- c(0.39326652, 0.72391174, -0.07690784, 0.37914638, 0.43709349, -1.28395765, -1.31900029,
      0.52676516, 0.37331202, -0.15362952)
colgroup <- c(2,4,4,2,2,3,3,2,2,2)
brands <- c('a','b','c','d','e','f','g','h','i','j')

plot3d(xvar, yvar, zvar, bbox=TRUE,
   type="s", col=colgroup, 
   size=0.05, alpha=0.50, radius=0.2,
   xlab="Cost Leader", ylab="Performance Leader", zlab="Fashion Leader")
text3d(x = xvar, y = yvar, z = zvar
   text = brands, adj=c(2.5,2.5), cex=0.7)

      

Questions:

  • How can I put a light shade in a 3D box so it's not white

  • How can I remove the x, y, z labels and their values ​​on the axis so that the plot is a little less distracting.

Thanks in advance!

Regards, Siddarth

+3


source to share


1 answer


You can manually add the bounding box using functions rgl.bbox

or bbox3d

:

plot3d(xvar, yvar, zvar, type = 's', col = colgroup, size = 0.05, alpha = 0.50, 
       radius = 0.2, xlab = 'Cost Leader', ylab = 'Performance Leader', 
       zlab = 'Fashion Leader', axes = FALSE)
rgl.bbox(xlen = 0, ylen = 0, zlen = 0, color = c('grey100'))
text3d(x = xvar, y = yvar, z = zvar, text = brands, adj = c(2.5,2.5), cex = 0.7)

      



3d plot

+3


source







All Articles