【发布时间】:2011-10-25 00:59:53
【问题描述】:
到目前为止,我已经设法按照示例 here 更改直方图中单个条的颜色
test <- rnorm(100);
h <- hist(test);
b <- cut(1, h$breaks);
clr <- rep("grey", length(h$counts));
clr[b] <- "red";
plot(h, col=clr);
我希望能够更改高于某个 x 轴值的直方图箱的颜色 - 例如在示例中的分布函数中高于 1。我遇到问题的部分原因是我不完全了解cut() 返回的因素。
【问题讨论】: