2

I would like to personalize my plot3d by adding a full grid and inserting a gray background. Also, I would like to put the labels on the middle of the scaled axes. I couldn't add the grid by using the grid() function. This is my reproducible example:

# Helix
x1 <- c(1,1) 
y1 <- c(1,1)
z1 <- c(1,2)

# Monopulse
x2 <- c(1,3) 
y2 <- c(1,2)
z2 <- c(1,1)

# Smart Shelf
x3 <- c(1,5) 
y3 <- c(1,5)
z3 <- c(1,5)

# Phased system
x4 <- c(1,2) 
y4 <- c(1,2)
z4 <- c(1,4)

rgl.bg(color = "gray")
grid <- expand.grid(x=x, y=y)
plot3d(x1, y1, z1, cex=1.5, size=4, type="l",col="red",lty=2,    xlab="Cost",ylab="Time",zlab="Space")
plot3d(x2, y2, z2, cex=1.5, size=4, type="l",col="blue",add=TRUE)
plot3d(x3, y3, z3, cex=1.5, size=4, type="l",col="green",add=TRUE)
plot3d(x4, y4, z4, cex=1.5, size=4, type="l",col="orange",add=TRUE)
aspect3d(1,1,1)
legend3d("topright", legend = c('Single beam', 'Narrow beam', 'Multibeam','Phased beam'), pch = 16, col = c("red","blue","green","orange"), cex=1, inset=c(0.02))
snapshot3d(filename = '3dplot.png', fmt = 'png')
Werner Hertzog
  • 2,002
  • 3
  • 24
  • 36
Ruser
  • 85
  • 1
  • 7

0 Answers0