I have my data points and cluster number as follows:
X Y cluster
-0.42042 0.2071 0
-1.4986 -1.8658 0
-0.50905 -0.0751 0
2.1978 1.9568 1
1.4901 1.6177 1
1.6961 1.8293 1
1.6021 0.0857 1
0.87831 0.71435 1
2.6688 1.3426 1
-1.741 0.90686 2
-1.8332 0.35599 2
-3.0733 0.42656 2
-2.1991 0.41843 2
-2.8099 0.93542 2
-1.3631 1.0914 2
The above data was unsorted, so I used sortrows
to sort in terms of cluster number and I get the above data.
I have to plot these clusters. Is there any MATLAB function for plotting clusters? I know we can use something like this: plot(M(:,1), M(:,2), '.');
But this plot all values in one cluster. I have to plot in three clusters as per data. The clusters are 0, 1,2. So three clusters with three different colors should be plotted. So something like this:
Any idea how to go about it?