load -ascii test1.txt;
test1xy = reshape(test1',2,numel(test1)/2)';
test1Grp = repmat((1:(size(test1,2)/2))',size(test1,1),1);
color = hsv(size(test1,1));
color = color(test1Grp,:);
gsh = gscatter(test1xy(:,1), test1xy(:,2), 1:size(test1xy,1), color, '.', 15, false);
markers = {'s' '^' 'p' 'h' 'v' 'd' 'x' 'o' '+'};
set(gsh,{'Marker'}, markers(:))
set(gsh,{'MarkerFaceColor'}, mat2cell(color,ones(size(color,1),1),3))
4 Comments
dpb (view profile)
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/485890-how-to-plot-a-graphic-with-different-markers-in-a-scatter-plot#comment_757343
SEVAL DONERTAS (view profile)
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/485890-how-to-plot-a-graphic-with-different-markers-in-a-scatter-plot#comment_757360
Adam (view profile)
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/485890-how-to-plot-a-graphic-with-different-markers-in-a-scatter-plot#comment_757366
SEVAL DONERTAS (view profile)
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/485890-how-to-plot-a-graphic-with-different-markers-in-a-scatter-plot#comment_757373
Sign in to comment.