Skip to content
Prev 66726 / 398525 Next

2d plotting and colours

Hi!

There are more than 8 colors.

x <- rbind(matrix(rnorm(100, sd = 0.3), ncol = 2),
                matrix(rnorm(100, mean = 1, sd = 0.3), ncol = 2))
     
(cl <- kmeans(x, i, 20))
    
s <- c("tomato4", "turquoise", "slateblue", "wheat", "snow", "skyblue",
"peru", "pink")
# see at:    
colors()
     
plot(x, col = s)
     
points(cl$centers, col = s, pch = 8, cex=2)


Best,
Matthias