Re: [R] [R-pkgs] ggplot: a new system for drawing graphics in R

From: Timm Danker <>
Date: Fri 07 Jul 2006 - 05:09:27 EST

I think the ggplot package is extremely promising. Parts of the dokumentation are very good alread, e.g I recently managed to write my first own grob function.
One thing I am missing in the dokumentation is a little more detail on how to modify the colours of a plot.
Specifically, if I have:

  xx<-"x y g bar
1 1 1 1
1 5 2 3
2 3 1 3
2 4 2 2"
df=read.table(textConnection(xx),header=T);df   ggplot(df, aes=list(y=y, x=factor(x),bar=bar))->p   ggbar(p, aes=list(fill=g,barcolour=g+1), avoid="dodge", sort=TRUE)

... I get a beatiful barplot, but would like to change the colors of the bars. I tried


and did not understand too much of the help file. I think some more examples would do it.


hadley wickham schrieb:
> ggplot provides a new system for drawing graphics in R, based on the
> Grammar of Graphics. It combines the advantages of both base and
> lattice graphics: conditioning and shared axes are handled
> automatically, and you can still build up a plot step by step from
> multiple data sources. It also implements a more sophisticated
> multidimensional conditioning system and a consistent interface to map
> data to visual attributes. ggplot (along with reshape) received the
> John Chambers Award for Statistical Computing.
> ggplot is available now from CRAN (install.packages("ggplot")) and
> more information is available at my website (
> including copies of talks, examples, and a guide showing how to
> convert your existing lattice code.
> To get started I recommend you look at:
> * the introductory vignette: vignette("introduction", "ggplot")
> * help for the quick plotting command: ?qplot
> * help for the full plotting commands: ?ggplot
> I want to provide great documentation, so if there is anything you
> think I am missing, please let me know.
> Regards,
> Hadley
> _______________________________________________
> R-packages mailing list
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Sat Jul 08 05:39:47 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 08 Jul 2006 - 08:15:26 EST.

Mailing list information is available at Please read the posting guide before posting to the list.