MATLAB: Wrong color of scatter points

colordotdotsproblemscatterwrong color

Hi,
i'm trying to scatter some points using the scatter functions. I set two conditions: the '.' and that the color should be blue with 'MarkerFaceColor','b' The problem is, that all the dots are getting different color.
Example Code:
hold off
x = rand(3,5);
y = rand(3,5);
for m = 1:length(x(1,:))
for n = 1:length(y(:,1))
scatter(x(n,m),y(n,m),'.','MarkerFaceColor','b');
hold on
end
end
Why is that? Im using Matlab R2015a Thank You

Best Answer

hold off
x = rand(3,5);
y = rand(3,5);
for m = 1:length(x(1,:))
for n = 1:length(y(:,1))
%scatter(x(n,m),y(n,m),'.','MarkerFaceColor','b');
scatter(x(n,m),y(n,m),'.b');
hold on
end
end