So I was plotting this code, but the text is overlapping. How can I fix this?
mayors <- read.csv("https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/brmayors.csv")
head(mayors)
mosaicplot(table(mayors$SIGLA_PARTIDO, mayors$DESCRICAO_SEXO), main = "Gender by party", color = "turquoise")
mosaicplot(table(mayors$SIGLA_PARTIDO, mayors$DESCRICAO_GRAU_INSTRUCAO), main = "Level of education by party", color = "plum")
You can control the direction of the axis labels with las =
. You can also control the size of the text with cex.axis =
.
mosaicplot(table(mayors$SIGLA_PARTIDO, mayors$DESCRICAO_GRAU_INSTRUCAO),
main = "Level of education by party",
color = "plum",
las = 2,
cex.axis = 0.5)