Wrong color of scatter points

4 visualizzazioni (ultimi 30 giorni)
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
0 CommentiMostra -1 commenti meno recentiNascondi -1 commenti meno recenti

Accedi per commentare.

Risposta accettata

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
1 CommentoMostra NessunoNascondi Nessuno
Norman Sterzel il 4 Gen 2016
Thank you!

Accedi per commentare.

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by