matlab plot different colors -
i have set of points (matrix nx1) , groups points (matrix nx1). want plot points (there no problem, this: plot(points, groups, 'o');
), i'd set unique color each group. how can this? have 2 groups (1,2).
use logical indexing select points want
figure; hold all; % keep old plots , cycle through colors ind = (groups == 1); % select points groups 1 % can kind of logical selections here: % ind = (groups < 5) plot(points(ind), groups(ind), 'o');
Comments
Post a Comment