【发布时间】:2020-06-11 04:57:45
【问题描述】:
我的种族/民族数据编码为 1-7,在我的 ggplot 条形图中,我用正确的名称重新命名了刻度线。
但是,它们被严重挤压在一起,无法读取。谁能告诉我要添加什么或如何调整我的代码以使标签的输入更小或间隔更好并且可以阅读?
非常感谢!
ggplot(my.data, aes(x = c_RaceEth), na.rm = TRUE) +
geom_bar(color = "#56B4E9", fill = "#000333") +
ggtitle("Distribution of Race/Ethnicity") +
labs(y= "Count", x = "Race/Ethnicity") +
scale_x_discrete(breaks=c("1","2", "3", "4", "5", "6", "7"),
labels=c("Asian or Asian Indian", "Black or African American", "Hispanic, Latino or Spanish", "American Indian or Alaska Native", "Other", "White", "Middle Eastern or North African"))
【问题讨论】: