Wrong color of scatter points

2 views (last 30 days)
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

Accepted Answer

Ilham Hardy
Ilham Hardy on 4 Jan 2016
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

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!