Reputation: 457
I have this code
ggplot(authors_interest_sex_count, aes(Country, freq, fill=Gender)) +
geom_bar(stat="identity", position="dodge") + geom_text(aes(label = freq), vjust=-1)
as you can see, the labels for each country are completely vertical, and I think the optimal solution would having each label on top of their column. What should I change or add in my code? Thanks in advance!
Upvotes: 0
Views: 2805
Reputation: 457
As Roman Luštrik commented, the answer I was looking for is
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)
Upvotes: 1