Skip to content
Back to formatted view

Raw Message

Message-ID: <1321523954.14938.21.camel@milan>
Date: 2011-11-17T09:59:14Z
From: Milan Bouchet-Valat
Subject: Getting unique colours
In-Reply-To: <1321502541504-4078889.post@n4.nabble.com>

Le mercredi 16 novembre 2011 ? 20:02 -0800, Quercus a ?crit :
> Hey everyone, 
> 
> I am new to R, and I'm making a scatter plot graph where i have a bunch of
> plots/points that fall into 9 unique categories. I want each category to
> have a unique colour, however, with the coding I have (below), the colour
> black is repeated for two of my plot types. Does anyone know a quick way to
> get 9 unique colours??
> 
> Coding:
> plotba = plot (predictedba ~ actualba, col=as.numeric(ecosite), pch=19,
> cex=1.5, ylab="Predicted Basal Area (m2/ha-1)", xlab="Actual Basal Area
> (m2/ha-1)")
> 
> Thanks!
You can use col=rainbow(9). For more choice about the color palette,
also see the RColorBrewer package.


> Here's what it looks like currently:
> 
> http://r.789695.n4.nabble.com/file/n4078889/predicted_height.jpeg 
Sorry, the link doesn't work.

Regards