Hi:
This is just something to get you started - you probably want a wider
range of colors than what is shown here. I used scale_fill_gradient2()
below; see its on-line help page for more information:
http://docs.ggplot2.org/current/scale_gradient2.html
You might also consider looking into colorRampPalette() or the
colorspace package for more options with scale_gradientn(). There are
several examples in Hadley's ggplot2 book that show how to define a
palette for use in a suitable scale_gradient*() function. (BTW, greens
and reds are not good choices for color palettes - see the help page
above for an explanation why.
#-----
TEMP <- structure(list(Annee = c("2004", "2005", "2006", "2007", "2008",
"2009", "2010", "2011", "2012", "2013"), Nbre = c(877L, 944L,
946L, 984L, 1238L, 1201L, 1256L, 1217L, 1349L, 1158L)), .Names = c("Annee",
"Nbre"), row.names = c(NA, -10L), class = "data.frame")
TEMP$Annee <- factor(TEMP$Annee)
library(ggplot2)
# avec ggplot
ggplot(TEMP, aes(x=Annee, y=Nbre)) +
geom_bar(aes(fill = Nbre), stat="identity", width = 0.7) +
scale_fill_gradient2(high = "darkgreen", low = "greenyellow", mid = "green")
#----
Dennis
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.