plot points in a different colour co ordinates
15 views (last 30 days)
Show older comments
x = randi([-35,165],[2000,1]);
x = x';
y = randi([-20,80],[2000,1]);
y = y';
plot(x,y,'kx','LineWidth',2,'MarkerSize',10)
I can also plot points with different colours within two circles.
num1 = 2000;
radius = 30;
theta = rand(1,num1)*(2*pi);
r = sqrt(rand(1,num1))*radius;
xCor = r.*cos(theta);
yCor = r.*sin(theta);
plot(xCor,yCor,'rx','LineWidth',2,'MarkerSize',10)
subplot(1,1,1)
hold on;
num = 1000;
rad = 10;
theta = rand(1,num)*(2*pi);
r = sqrt(rand(1,num))*rad;
xCor2 = r.*cos(theta);
yCor2 = r.*sin(theta);
plot(xCor2,yCor2,'gx','LineWidth',2,'MarkerSize',10)
Thanks...
1 Comment
Walter Roberson
on 19 Feb 2013
This looks to me to be exactly the same discussion as is taking place in Andy's question http://www.mathworks.co.uk/matlabcentral/answers/63990-plot-points-in-a-different-colour-depending-on-co-ordinates
Answers (0)
See Also
Categories
Find more on Data Distribution 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!