使用scale_fill_gradient

时间:2015-10-27 08:34:03

标签: r ggplot2 colorbrewer

继续this question

以下工作正常:

manipulate({ggplot(map.df, aes_string(x='long', y='lat', group='group', fill=ObesityYear)) + 
    geom_polygon()+coord_map()+ 
    labs(title="2010 Adult Obesity by County, percent",x="",y="")+ 
    theme_bw()}, ObesityYear = picker("obesity09", "obesity10", "obesity13"))

但这会产生错误:

manipulate({ggplot(map.df, aes_string(x='long', y='lat', group='group', fill=ObesityYear)) + 
    geom_polygon()+coord_map()+
    scale_fill_gradient("",colours=brewer.pal(9,"YlOrRd"))+
    labs(title="2010 Adult Obesity by County, percent",x="",y="")+ 
    theme_bw()}, ObesityYear = picker("obesity09", "obesity10", "obesity13"))

错误:

Error in continuous_scale("fill", "gradient", seq_gradient_pal(low, high,  : 
  unused argument (colours = c("#FFFFCC", "#FFEDA0", "#FED976", "#FEB24C", "#FD8D3C", "#FC4E2A", "#E31A1C", "#BD0026", "#800026"))

0 个答案:

没有答案