【发布时间】:2017-12-25 15:18:57
【问题描述】:
我正在尝试创建条形图,但由于字符串的长度,标签重叠。我尝试缩短字符串的名称,但这会改变底层顺序。当我手动尝试使用 levels 设置顺序时,我得到了一堆 NA。
ggplot(income_educa_copy, aes(x = factor(X_educag), fill = X_incomg))+
geom_bar(position = position_fill(reverse = TRUE)) +
ggtitle("Educational Achievement of Respondents") +
scale_fill_brewer("Income \nLevel",palette="Green",direction=-1) +
xlab("Educational Achievement") +
ylab("Proportion")
以下是图表图像的链接。 Bar Plot Image
【问题讨论】: