ggplot2 barplot渐变填充

时间:2016-05-30 14:27:36

标签: r plot ggplot2

我最近在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

所以我试图绘制例如渐变,其中最大计数将是暗的,低计数的白色,以灰色阴影为主。

0 个答案:

没有答案