Hi! Can anyone help me in my struggle to combine these two graphs into one? Ideally the coloured plot should be overlaid by the step plot, so that counts of "ox_=" are shown as steps on the coloured graph.
I have PLOT 1:
ggplot(subset(stw, !is.na(will)), aes(ox_0, fill=will)) +
geom_bar(position="fill") +
ggtitle("Willingness to repeat surgery per Oxford Knee Score at baseline") +
xlab("Preoperative Oxford Knee Score")+ ylab("")+
scale_y_continuous("", labels=c("0 %", "25%", "50%", "75%", "100%"))+
theme(
axis.text.y = element_text(size=12, color=1),
axis.title.x = element_text(size=15, color=1),
axis.text.x = element_text(size=12, color=1),
axis.title.y = element_text(size=15, color=1),
plot.title = element_text(hjust=0.5, size=16),
strip.text.x = element_text(size=12),
legend.text = element_text(size=13),
legend.title = element_text(size=15))+
scale_fill_manual("Would you repeat surgery?", values=col.traf, aesthetics = "fill")
and PLOT 2:
ggplot(subset(stw, !is.na(will)), aes(ox_0))+
stat_bin(geom="step", binwidth = 1)