[R] discerning plot dots using colors

Daisy Englert Duursma daisy.duursma at gmail.com
Wed Oct 27 00:13:03 CEST 2010


There are several ways to do this but the package ggplot2

library(ggplot2)
qplot(displ,hwy,data=mpg,colour=factor(cyl))


On Wed, Oct 27, 2010 at 9:06 AM, elaine kuo <elaine.kuo.tw at gmail.com> wrote:
> Dear List,
>
>
>
> I am using the command plot to present the relationship
>
> between bird richness (Y axis) and elevation (X axis).
>
>
>
> However, I would like to observe
>
> the distributions of bird richness in different administrative areas (A, B,
> C, …., G) in this plot.
>
> For example, the dots in area A might fall in the upper right part of the
> plot,     while those in area B might appear in the middle of the elevation
> range.
>
>
>
> Please kindly advise how to differentiate the dots in distinct areas using
> colors.
>
> Thank you.
>
>
>
> Elaine
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



-- 
Daisy Englert Duursma

Room E8C156
Dept. Biological Sciences
Macquarie University  NSW  2109
Australia

Tel +61 2 9850 9256



Unit 2, 35 Denison St
Hornsby, NSW 2077

Mobile: 0421858456



More information about the R-help mailing list