📅  最后修改于: 2022-03-11 14:56:55.086000             🧑  作者: Mango
ggplot(tips, aes(x= day, group=sex)) +
geom_bar(aes(y = ..prop.., fill = factor(..x..)), stat="count") +
geom_text(aes( label = scales::percent(..prop..),
y= ..prop.. ), stat= "count", vjust = -.5) +
labs(y = "Percent", fill="day") +
facet_grid(~sex) +
scale_y_continuous(labels = scales::percent)