我正在处理以下ggplot:
ggplot(aes(x = Age ) , data = df2) +
geom_histogram(aes(fill=Term), binwidth=2, colour="grey20", lwd=0.2)+
stat_bin(binwidth=2, geom="text", colour="white", size=2,
aes(label=((..count..)/sum(..count..)), group=Term),
position=position_stack(vjust=0.5)) +
scale_x_continuous(breaks=seq(0, 100), limits = c(50,95))+
scale_y_continuous(labels=percent)
哪个会产生:
谢谢您的帮助。