[英]Labels geom_bar in ggplot R
我有这个代码
ggplot(authors_interest_sex_count, aes(Country, freq, fill=Gender)) + geom_bar(stat="identity", position="dodge") + geom_text(aes(label = freq), vjust=-1)
我得到了这张图片:
如您所见,每个国家/地区的标签都是完全垂直的,我认为最佳解决方案是将每个标签放在其列的顶部。 我应该更改或添加什么代码? 提前致谢!
正如RomanLuštrik所说,我一直在寻找答案
ggplot(authors_interest_sex_count, aes(Country, freq, fill=Gender)) + geom_bar(stat="identity", position="dodge") + geom_text(aes(label = freq), position=position_dodge(width=0.9), vjust=-1)
谢谢!
[英]R ggplot2 geom_bar add labels with % sign
[英]R ggplot geom_bar, include labels even if data is missing
[英]R ggplot2: labels inside bars, no stacked geom_bar
[英]How to put labels over geom_bar in R with ggplot2
[英]R: change bar labels in geom_bar
[英]R: ggplot2 geom_text data labels for binned geom_bar
[英]R ggplot geom_bar facet dodge
[英]Order columns in geom_bar in ggplot in R
[英]R - ggplot - Rounded extremity for geom_bar
[英]Ggplot geom_bar for large dataset in R
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.