How to produce a pretty plot of the results of k-means cluster analysis? I'm using R to do K-means clustering. I'm using 14 variables to run K-means


*

*What is a pretty way to plot the results of K-means? 

*Are there any existing implementations?

*Does having 14 variables complicate plotting the results? 


I found something called GGcluster which looks cool but it is still in development. 
I also read something about sammon mapping, but didn't understand it very well. Would this be a good option? 
 A: Here an example that can helps you:
library(cluster)
library(fpc)

data(iris)
dat &lt- iris[, -5] # without known classification 
# Kmeans clustre analysis
clus &lt- kmeans(dat, centers=3)

# Fig 01
plotcluster(dat, clus$cluster)


# More complex
clusplot(dat, clus$cluster, color=TRUE, shade=TRUE, 
         labels=2, lines=0)


# Fig 03
with(iris, pairs(dat, col=c(1:3)[clus$cluster])) 


Based on the latter plot you could decide which of your initial variables to plot. Maybe 14 variables are huge, so you can try a principal component analysis (PCA) before and then use the first two or three components from the PCA to perform the cluster analysis.
A: The simplest way I know to do that is the following:
X <- data.frame(c1=c(0,1,2,4,5,4,6,7),c2=c(0,1,2,3,3,4,5,5))
km <- kmeans(X, center=2)
plot(X,col=km$cluster)
points(km$center,col=1:2,pch=8,cex=1)

In this way you can draw the points of each cluster using a different color and their centroids.
A: I'd push the silhouette plot for this, because it's unlikely that you'll get much actionable information from pair plots when the number of dimension is 14.
library(cluster)
library(HSAUR)
data(pottery)
km    <- kmeans(pottery,3)
dissE <- daisy(pottery) 
dE2   <- dissE^2
sk2   <- silhouette(km$cl, dE2)
plot(sk2)

This approach is highly cited and well known (see here for an explanation). 
Rousseeuw, P.J. (1987) Silhouettes: A graphical aid to the
 interpretation and validation of cluster analysis. J. Comput.
  Appl. Math., 20, 53-65.
A: This is an old question at this point, but I think the factoextra package has several useful tools for clustering and plots.  For example, the fviz_cluster() function, which plots PCA dimensions 1 and 2 in a scatter plot and colors and groups the clusters.  This demo goes through some different functions from factoextra.
