I would like to fill the area under a step function line I ploted using plot(X, type='s')
I tried polygon
with no success.
set.seed(1);y = abs(rnorm(10))
plot(y,ylim=c(0,max(y)), type="p",pch=24)
lines(y, type='s')
abline(h=0)
Say I want to paint in gray under the curve and above y=0