Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Use the palette defined here (cb_palette)
with scale_fill_manual() (Figure 12-10):
library(gcookbook)# For the data set# Base plotp<-ggplot(uspopage,aes(x=Year,y=Thousands,fill=AgeGroup))+geom_area()# The palette with grey:cb_palette<-c("#999999","#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7")# Add it to the plotp+scale_fill_manual(values=cb_palette)
A chart of the colors is shown in Figure 12-11.
In some cases it may be better to use black instead of grey. To
do this, replace the "#999999" with
"#000000" or "black":