user
user

Reputation: 21

How do I separate the text from my ggplot?

How can I make the captions not overlap?

mayors <- read.csv("https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/brmayors.csv")
ggplot(mayors, aes(DESCRICAO_GRAU_INSTRUCAO)) + geom_bar()
'''

Upvotes: 1

Views: 41

Answers (1)

Greg
Greg

Reputation: 3660

You could rotate the labels (here to 45, but you can pick) with theme

library(ggplot2)
ggplot(mayors, aes(DESCRICAO_GRAU_INSTRUCAO)) + geom_bar() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

enter image description here

Upvotes: 1

Related Questions