2

所以我正在绘制这段代码,但文本是重叠的。我怎样才能解决这个问题? 在此处输入图像描述

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")

在此处输入图像描述

4

1 回答 1

2

您可以使用 控制轴标签的方向las =。您还可以使用 控制文本的大小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)

在此处输入图像描述

于 2020-05-19T14:34:37.623 回答