[R] fill circles
h.wickham at gmail.com
Sun Aug 26 18:35:26 CEST 2007
You could use the ggplot2 package (http://had.co.nz/ggplot2) which
takes care of many of these details for you:
qplot(Height, Volume, data=trees, size = Girth)
qplot(Height, Volume, data=trees, size = Girth, colour=Height)
You can find more details on the website about how to customise the
scales for your needs, but the defaults should be pretty good.
On 8/25/07, Cristian cristian <taccioli at gmail.com> wrote:
> Hi all,
> I'm an R newbie,
> I did this script to create a scatterplot using the "tree" matrix from
> "datasets" package:
> plot(Height, Volume, pch=3, xlab="Height", ylab="Volume")
> symbols(Height, Volume, circles=Girth/12, fg="grey", inches=FALSE,
> I'd like to use the column Named "Height" to fill the circles with colors
> (ex.: the small numbers in green then yellow and the high numbers in red).
> I'd like to have a legend for the size and the colors too.
> I did it manually using a script like that:
> color[(x>=0.008)&(x<0.009)]<-"#00C300" and so on but I don't like to do it
> manually... do know a solution...
> Thank you very much
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help