[英]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.