I have X matrix points in three dimensions ( X is an Nx3 matrix), and these points belong to clusters. The vector Nx1 Cluster belongs to the Cluster (it has values, such as 1,2,3, ...). So, I draw it on scatter3 as follows:
scatter3(X(:,1),X(:,2),X(:,3),15,Cluster)
It works great, but I would like to add a legend to it showing the color markers and the cluster that it represents.
For example, if I have 3 clusters, I would like to have a legend like:
<blue o> - Cluster 1 <red o> - Cluster 2 <yellow o> - Cluster 3
Thank you for help!
source share