Wrong color of scatter points
    6 views (last 30 days)
  
       Show older comments
    
    Norman Sterzel
 on 4 Jan 2016
  
    
    
    
    
    Commented: Norman Sterzel
 on 4 Jan 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 Comments
Accepted Answer
  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)
See Also
Categories
				Find more on Scatter Plots in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
