我有一些来自李克特调查的数据。调查的范围是从 1 到 5。我正在计算为每个问题选择的答案的百分比。我的问题是在绘制这些百分比时,x 轴的边界似乎是无穷无尽的。这是我用来绘制的代码:
#Get the proportion table for the factored responses and melt it using the reshape2 package
#Graph it using the factor levels for X and the value converted into percentage for y
ggplot(melt(prop.table(table(factor(jsp.df$Q1,
levels =c(1, 2, 3, 4, 5))))),
aes(x=Var1, y=value*100)) +
geom_bar(stat="identity") +
labs(title = "Q1: Deaf People Will be in College\n", x = "\nLikert Factors\n", y="Percent Circled\n") +
ylim(c(0,100)) +
#Replace factor levels with label names
scale_x_discrete(breaks=c(1, 2, 3, 4, 5), labels=c("Very Good \nChance", "Fairly Good \nChance", "Some \nChance", "A Little \nChance", "No \nChance"))
结果附后。固定x轴的最佳方法是什么?谢谢