R: plot3D scatter3D, 有没有 coord_fixed() 选项?
R: plot3D scatter3D, is there a coord_fixed() option?
我正在使用 ggplot2
和 plot3d
在 2D 和 3D 中绘制相同的散点图。我总是喜欢尽可能在 ggplot2
散点图中做 coord_fixed()
,以获得更好的可读性。有没有办法在 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
:
If scale is TRUE the x, y and z coordinates are transformed separately. If scale is FALSE the coordinates are scaled so that aspect ratios are retained
我正在使用 ggplot2
和 plot3d
在 2D 和 3D 中绘制相同的散点图。我总是喜欢尽可能在 ggplot2
散点图中做 coord_fixed()
,以获得更好的可读性。有没有办法在 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
:
If scale is TRUE the x, y and z coordinates are transformed separately. If scale is FALSE the coordinates are scaled so that aspect ratios are retained