I use the "gscatter" function as follow:
>> h1 = gscatter(X,Y,GroupVariable,Colors([5 5 7 7],:),'.x.x');
Ideally, "GroupVariable" can contain either 1, 2, 3 or 4, and I want to the data point to be plotted with "Color(5,:)" if it is from 1 or 2 and "Color(7,:)" if it is from group 3 or 4.
However, with the current data set I am working on, "GroupVariable" is a 10×1 vector that shows only two values (1 and 3 in mixed order)
This causes all points in the plot get the same color, instead of what I desired.
Best Answer