I am trying to build a stacked step line graphic, adding cumulative area under a set of 4 (cumulative) survival curves. But geom_area() and geom_ribbon() seem to want to plot under regular, not step lines. Here I have plotted the ribbon and the step line in the reverse order so that one can see in red what the boundary should be, and in the blue the fill area supplied by geom_area).
pt1 %>% ggplot() + geom_area(aes(time, state4), fill = 'blue', alpha = 0.8) +
geom_step(aes(time, state4), col = 'red')
Is there a way to convince the geom_area (or geom_fill) to use the step_line borders instead of the usual line borders? Thanks for any help with this issue.