I am carrying out clustering and try to plot the result. A dummy data set is :
data
import numpy as np
X = np.random.randn(10)
Y = np.random.randn(10)
Cluster = np.array([0, 1, 1, 1, 3, 2, 2, 3, 0, 2]) # Labels of cluster 0 to 3
cluster center
centers = np.random.randn(4, 2) # 4 centers, each center is a 2D point
Question
I want to make a scatter plot to show the points in data
and color the points based on the cluster labels.
Then I want to superimpose the center
points on the same scatter plot, in another shape (e.g. 'X') and a fifth color (as there are 4 clusters).
Comment
- I turned to seaborn 0.6.0 but found no API to accomplish the task.
- ggplot by yhat could made the scatter plot nice but the second plot would replace the first one.
- I got confused by the
color
andcmap
in matplotlib so I wonder if I could use seaborn or ggplot to do it.