[英]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.