Wrong color of scatter points

2 visualizzazioni (ultimi 30 giorni)
Norman Sterzel
Norman Sterzel il 4 Gen 2016
Commentato: Norman Sterzel il 4 Gen 2016
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

Risposta accettata

Ilham Hardy
Ilham Hardy il 4 Gen 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

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by