[R] 2d plotting and colours

Asha Jayanthi ashajayanthi at hotmail.com
Wed Mar 30 08:20:37 CEST 2005


Hi!

I am new to R just 3 days in it and i apologize if my questions seem very 
trivial and consumed your valuable time.

I am coding in perl and i stumbled upon R regarding plotting good 
statistical graphs.

I tried the kmean clustering for a large matrix ,say > 150 * 150 . I tried 
the example code given in the tutorial to perform 2d plot

# i ranges from 2 to 10
cl <- kmeans(x, i, 20)
plot(x, col = cl$cluster)
points(cl$centers, col = 1:i )

I see that there are only 8 colours defined , namely 
black,red,green,blue,cyan,magenta,yello,gray.

How should i set my colour preferences to obtain my palette of colours? I  
checked in the totorial which talks about R.colors and palatte , but i 
failed to understand how to set it.

Thank You

Asha





More information about the R-help mailing list