【发布时间】:2017-11-27 15:40:56
【问题描述】:
我需要关于在 ggplot 中绘制 > 741 行的帮助。
- 一个特定行的颜色不应改变,例如颜色线应仅由 eci 的最终值分配。
- 我想在每行的开头和结尾显示每行的名称(在代码示例中为“单元”)
-
当然,超过 700 条线很难用肉眼区分,但是有什么建议可以让这些线更容易区分吗?
df <- data.frame(unit=rep(1:741, 4), year=rep(c(2012, 2013, 2014, 2015), each=741), eci=round(runif(2964, 1, 741), digits = 0)) g = ggplot(data = df, aes(x=year, y=eci, group=unit)) + geom_line(aes(colour=eci), size=0.01) + scale_colour_gradientn(colours = terrain.colors(10)) + geom_point(aes(colour=eci), size=0.04) # The colour of the line should be determined by all eci for which year=2015
【问题讨论】:
-
很抱歉 - 我现在无法将代码格式化为正确的格式。