How to switch order of clusters in silhouette plot?
Show older comments
I am showing silhouette plots for various k-means implementations in a presentation, and the data tend to separate into two clusters: a smaller one and a larger one. I will be comparing the plots on the same page, so I would like the smaller cluster to always be on the top of the plor, and the larger one on the bottom; however, this is determined by cluster 1 and 2 in the data, which is assigned arbitrarily. Is there an easy way with code to switch which cluster is "on top" in a silhouette plot?
Accepted Answer
More Answers (1)
darova
on 14 Feb 2021
what about this?
x = rand(20,1);
y = rand(20,1);
plot(x(1:15),y(1:15),'.r')
hold on
plot(x(5:end),y(5:end),'ob')
hold off

Categories
Find more on Cluster Analysis and Anomaly Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
