[英]R- how to plot cumulative lines
我无法复制你的数据,所以这更像是一个评论,然后是一个完整的解决方案。
n <- sum(h$counts) # This should sum up to the number of observations
y <- cumsum(h$counts) / n # Your y values
x <- h$mids # I assume these to be your x-axis value, but this might need an edit.
plot(x = x, y = y, type = "l")
最后,您可以通过abline()
function 在相应的点添加垂直线和水平线。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.