MATLAB: Plotting with different colored markers

markersplot

Hi All,
As you know, the plot command gives each line a different color so that the user can distinguish between the each dataset. When you have two lines, you have 2 colors…6 lines, 6 colors etc. Very convenient.
How can I do this but for markers instead? The number of datasets I want to plot is different each time…I might have 2,3,4,5 up to x datasets. Is there a way to represent each set using a different marker (when the number of sets is variable)?

Best Answer

You can use scatter() and give each marker its own color if you want. You can put them on top of a line/curve plot if you want if you call "hold on" in between calls to plot() and scatter().