以下是我的数据集
feature_user <- data.frame (Features = c("Battery","Build_Design", "Camera","Connectivity","Delivery",
"Design", "Display", "Gaming_Experience", "Performance",
"Post_Usage", "Protection", "Recommendation", "Sound", "Value_Money"),
Users = c(852, 89, 471, 96, 228, 143, 131, 18, 379, 354, 35, 271, 99, 510))
我正在尝试使用以下代码来绘制数据
library(ggplot2)
ggplot(feature_user, aes(x = reorder(Features, Users), y = Users)) +
geom_bar(stat = "identity", position = "dodge") +
scale_fill_brewer(palette = "Set1") +
coord_flip() +
ggtitle("Most Talked Feature by Users") +
ylab("No of Users") +
xlab("Features")
但是问题是,我没有按照scale_fill_brewer中提到的颜色代码获得输出。相反,我得到纯灰色的条形图。我不确定是什么问题。请帮助
答案 0 :(得分:1)