我最近在ggplot环境中处理过条形图,我似乎无法从左到右创建渐变。它会引发某种关于身份的错误。
theTable <- within(data,
Position <- factor(column1,
levels=names(sort(table(column1),
decreasing=TRUE))))
ggplot(theTable, aes(x = factor(column1)))+
geom_bar(color="black", alpha=0.3)+
labs(x = "stuff1")+
labs(y = "stuff2")+
labs(title = "stuff3")+
theme(axis.text=element_text(size=17),
axis.title=element_text(size=14,face="bold"), title=element_text(size=20))+
geom_text(stat='count',aes(label=..count..),vjust=-1)+
scale_color_manual(values=c("#999999", "#E69F00", "#56B4E9"))#this doesn't work also
所以我试图绘制例如渐变,其中最大计数将是暗的,低计数的白色,以灰色阴影为主。