- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这
MASS 包中的 parcoord 函数看起来很不错,但是我如何向
四个y轴?
代码在这里:
ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3])
parcoord(log(ir)[, c(3, 4, 2, 1)], col = 1 + (0:149)%/%50)
最佳答案
您是否尝试设置 var.label=T
在 parcoord
功能?这还不够吗?
否则,我没有看到任何使用默认功能更改轴的简单方法。但事实证明,该函数非常短,我们可以轻松地从它那里窃取想法并制作我们自己的版本。这是修改它的一种方法
parcoordlabel<-function (x, col = 1, lty = 1, lblcol="blue",...)
{
df <- as.data.frame(x)
pr <- lapply(df, pretty)
rx <- lapply(pr, range, na.rm = TRUE)
x <- mapply(function(x,r) {
(x-r[1])/(r[2]-r[1])
},
df, rx)
matplot(1L:ncol(x), t(x), type = "l", col = col, lty = lty,
xlab = "", ylab = "", axes = FALSE, ...)
axis(1, at = 1L:ncol(x), labels = colnames(x))
for (i in 1L:ncol(x)) {
lines(c(i, i), c(0, 1), col = "grey70")
text(c(i, i), seq(0,1,length.out=length(pr[[i]])), labels = pr[[i]],
xpd = NA, col=lblcol)
}
invisible()
}
ir <- log(rbind(iris3[,,1], iris3[,,2], iris3[,,3]))[,c(3,4,2,1)]
parcoordlabel(ir, col = 1 + (0:149)%/%50)
关于r - 向 parcoord 添加刻度(平行坐标图),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23553210/
这个问题在这里已经有了答案: Can I get `cabal install` to use multiple cores? (3 个回答) 关闭 7 年前。 在使用类似于 GNU make 的 -
我正在尝试通过 akeeba backup 在 parallels plesk 面板中安装一个 joomla 站点。我在哪里面临文件权限问题。 An error occured Could not o
我在 MATLAB 中使用箱线图函数。我需要为 6 个“XTicks”绘制 6 个不同数据集的箱线图,即 x 轴上的每个刻度线应包含 6 个相应的框、晶须、中线和其域内的异常值集。我尝试通过为每个变量
我需要在 Kaplan Meier 图上呈现 at_risk 数字。 最终结果应该与此类似: 我在渲染时遇到的问题是 No。处于危险中的患者数量位于图表底部。此处显示的值对应于 x 轴上的值。因此本质
我想知道你们中的任何一个人为什么知道我的表现糟透了吗? 我正在努力实现的目标; 生成220万个文件。要创建每个文件,平均需要2-5个数据库调用。 我正在使用的服务器具有24个内核和190GB的RAM。
请帮忙。我正在研究具有此要求的算法。 给定 4 个“右”矩形(右矩形的边平行于 x 或 y),找出它们中的任何一个覆盖的区域 例如,灰色区域被下图中的 4 个矩形中的任何一个覆盖。 enter ima
我是一名优秀的程序员,十分优秀!