【发布时间】:2017-04-24 11:55:16
【问题描述】:
我想在两个逐步函数之间绘制区域。
我尝试过geom_ribbon,但我通过插值而不是间隔恒定来获得平局。
comb = data.frame(time=rexp(20),n1=rep(1:10,each=2),n2=seq(from=2, to=11.5,by=0.5))
ggplot(comb) + geom_ribbon(aes(x=cumsum(time), ymin=n1, ymax=n2), fill="blue", alpha=.4) + geom_step(aes(x=cumsum(time), y=n1))+ geom_step(aes(x=cumsum(time), y=n2))
感谢任何帮助。
【问题讨论】:
-
您能否通过提供几行数据来将其作为可重现性最低的示例?
-
是的!对不起。我刚刚编辑过。