...
c=[102, 215, 209;253,174,97;215,25,28]/255;
m=['o','d','s'];
figure, hold on
for i=1:size(x,2)
scatter (x(:,i), y(:,i), 'MarkerFaceColor', c(i,:),'Marker',m(i))
end
First thought you wanted one by column and the other by row; that's not doable except by every point an object...this is ok as each row is a single object.
ADDENDUM
OK, so my first thought was right; the above is right answer to wrong Q??? :)
You're fortunate there are more than twelve possible markers already defined; you do just like for the colors, define(*) an array of their names and use it...
m={'+', 'o', '*', '.', 'x', 'square', 'diamond', 'v', '^', '>', '<', 'pentagram'};
[nr,nc]=size(x);
for i=1:nr
for j=1:nc
scatter(x(i,j),y(i,j),'MarkerFaceColor',c(j,:),'Marker',m{i})
end
end
(*) I created the list by causing scatter to error on a bad call at which it echos the allowable list of names a la the list in the doc. There has to be a way to use the default marker order vector and factory defaults for the markers to automate this but I've never been able to get through the maze to figure out how to get to the information in useful manner...for all the doc there is, much of HG2 is highly opaque and almost impenetrable to the casual user who doesn't have time nor inclination to learn the details of the object hierarchy. It's like being a casual Excel user and try to write a "quick" macro--just ain't a-gonna' happen. :(
Best Answer