MATLAB: Plotting connected dots with two different colors (One for the dots and one for the lines)


Hello everyone,
So I guess that my problem is well explained in the title. I want to chage the color of the dots but not the one of the lines that connect the dots.
Here is the line that plots this figure :
Thanks you in advance for your answers.

Best Answer

It is the 'MarkerEdgeColor' and 'MarkerFaceColor' properties.
data = randn(4,1)*3;
p = plot(data,'-','color',[0.7 0 0.7],'LineWidth',3,...
'Marker','o','MarkerEdgeColor',[0.7 0.7 0],'MarkerFaceColor',[0 0.7 0.7]);
I've added an outputhandle for the line, that makes it easier to change the properties afterwards.