MATLAB: How to use different markers for different X,Y pairs

graphicsmarkersMATLAB

I'd like to have separated (X,Y) points, marked by different markers and legend that describes those points. When I use plot(x1,y1,'+',x2,y2,'o') I have error message. Solution with plot()… hold on; plot()… is not convenient because in such a case legend not shows all pairs information. Thanks for ideas.

Best Answer

Plot by using two separate calls to plot:
plot(x1(1),y1(1),'>','MarkerEdgeColor','y','MarkerFaceColor','m');
hold on
plot(x2(2),y2(2),'<','MarkerEdgeColor','m','MarkerFaceColor','c');
or whatever - not sure exactly what is a point and what is an array with your x,y. But anyway, this works - I've tried it.