R:plot3D scatter3D,是否有coord_fixed()选项?

问题描述 投票:0回答:1

我正在使用ggplot2plot3d在2D和3D中进行相同的散点图。我总是喜欢在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")

fig1

fig2

r 3d coordinates scatter
1个回答
2
投票

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,则缩放坐标以保留纵横比

© www.soinside.com 2019 - 2024. All rights reserved.