我正在使用ggplot2
和在 2D 和 3D 中绘制相同的散点图plot3d
。我总是喜欢做coord_fixed()
的ggplot2
散点图可能的情况下,为了更好的可读性。有没有办法在scatter3D
情节中做同样的事情?
MWE:
data(iris)
head(iris)
library(ggplot2)
ggplot(iris, aes(x=Petal.Length, y=Petal.Width)) +
geom_point(pch=16) + theme_light() + coord_fixed()
library(plot3D)
scatter3D(iris$Petal.Length, iris$Sepal.Length, iris$Petal.Width, bty = "u", pch = 16, alpha = 0.5,
xlab = "Petal.Length", ylab = "Sepal.Length", zlab = "Petal.Width", phi = 0, theta = 40,
col.panel = "white", col.grid = "gray", col="black", ticktype = "detailed")
scale = FALSE
做这个:
scatter3D(iris$Petal.Length, iris$Sepal.Length, iris$Petal.Width, bty = "u", pch = 16, alpha = 0.5,
xlab = "Petal.Length", ylab = "Sepal.Length", zlab = "Petal.Width", phi = 0, theta = 40,
col.panel = "white", col.grid = "gray", col="black", ticktype = "detailed",
scale = FALSE)
来自?persp
:
如果 scale 为 TRUE,则分别转换 x、y 和 z 坐标。如果 scale 为 FALSE,则缩放坐标以保留纵横比
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句