R - ggplot2 'dodge' geom_step() to overlap geom_bar()
问题 Plotting counts using ggplot2's geom_bar(stat="identity") is an effective method of visualising counts. I would like to use this method to display my observed counts and compare them to expected counts I would like to do this by using geom_step to overlay a stairstep plot layer over the barplot. However when I do this I run into the problem that barplots by default have their positions dodged but geom_step does not. For example using both continuous and discrete dependent variables: library