我想plot3d
通过添加一个完整的网格并插入一个灰色背景来个性化我的。另外,我想将标签放在缩放轴的中间。我无法使用该grid()
功能添加网格。这是我的可重现示例:
# 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')