r - R:plot3D scatter3D,有 coord_fixed() 选项吗?
问题描述
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,则缩放坐标以保留纵横比
推荐阅读
- blazor - Blazor websocket 消息解码
- r - 不同列组合的线性回归模型
- visual-studio-code - VS Code中编译运行代码的问题
- reactjs - 减速器并不总是删除正确的项目
- rdf - DBPedia Live Api 不返回所有属性类型,而只返回 dbp 和 dct
- swift - SwiftUI 将覆盖内容传递给父视图
- jupyter-notebook - Google Colab 无法连接到本地 jupyter
- azure - New-AzResourceGroupDeployment 不会抛出详细信息
- laravel - Laravel - 如何制作一个每天在同一时间运行的函数?
- excel - 用于更改具有大量数据的数据透视表的源的 VBA 代码