r - 在 R 中使用 plot3D::scatter3D() 更改刻度标签
问题描述
我正在尝试使用scatter3D()
R 中的函数制作如下图:
到目前为止一切顺利,但我正在努力将轴上的刻度标签Variant
从 1, 2, 3 更改为A
, B
, C
。有什么方法可以实现吗?
要创建上面的图:
library(plot3D)
n = 20 # number of datapoints
y = rep(c(1,2,3), each = n) # for plotting each line
x = rep(seq(-2, 2, length.out = n),3)
z = pnorm(x)
lapply(1:3, function(index){
add = TRUE
if(index == 1)
add = FALSE
scatter3D(x = x[y == index],
z = z[y == index],
y = y[y == index],
type = "l",
phi = 20,
theta = -50,
xlab = "RT1",
ylab = "Variant",
zlab = "Delta",
col = "red",
ticktype = "detailed",
add = add,
ylim = c(0,4),
xlim = c(-3, 3))
})
解决方案
推荐阅读
- python - 尝试使用 python 套接字库向服务器发送请求,出现类型错误
- python - 如何查询自定义字段的多对多关系表
- python - 如何在python中按另一列的标准过滤时取一列的平均值
- colors - 我无法为我的品种设置不同的颜色
- java - 如何在 Liferay 6.2 中下载所有文件夹内容
- php - 如何使用 HTTP 参数修复未定义的索引错误?
- linux - 安全地从 $PATH 中删除重复项,Ubuntu 16.04
- jquery - 如何将 JQUERY 数据表内容获取到 MVC 控制器
- java - Gson 不使用 Java 中的父类
- sql-server - SQL Server 存储过程的函数序列错误