Plotting a grouped 2 dimensional vector in MATLAB
- by Hossein
I am trying to make a plot of a 2-dimensional vector (2D Plot). But I don't want all the datapoints to have the same color on the plot. Each datapoint corresponds to a group. I want to have different colors for each group of datapoints.
class=[1 3 2 5 2 5 1 3 3 4 2 2 2]
says each datapoint belongs to which group
X=[x1,y1;x2,y2;x3,y3;.....]
the number of these datapoints are the same as the number of elements in the class vector.
Now I want to plot these based on colors.