1
这里是我的数据R将不会让我改变单个条的颜色上ggplot无论什么
structure(list(summresolution = c("New supplier Found", "Supplier educated about DMEPOS\n",
"Unresolved", "Supplier educated about DMEPOS\n",
"Resolved by current supplier",
"Supplier educated about inquiry\n")))
我使用这个代码创建一个ggplot列:
sumrc<-ggplot(subset(longdata,!is.na(summresolution)),
aes(x=summresolution))
sumrcbycount <- sumrc +
geom_bar(stat = "count") +
coord_flip()+
scale_fill_manual("legend",
values = c("New supplier Found" = "black",
"Beneficiary Educated" = "orange",
"Resolved by current supplier" = "blue",
"Unresolved"= "red"))
print(sumrcbycount)
我已经在网上搜寻了答案,因为它看起来像一个简单的问题,但不管我做什么,颜色都是黑色的。
你的榜样不起作用。清理你的工作空间并尝试自己。 –
你是什么意思?所有酒吧会有一种颜色还是每个酒吧有不同的颜色? – LyzandeR
好的我在这里有一个非常大的数据集,我只是试图显示1列数据我建立我的图表。我是R的新手,也是Stack的新手,所以我不太擅长提供像你所想的那样的示例数据。创建图表的代码是100%正确的,因为它可以在我的控制台中工作。为什么不改变颜色寿? –