plot points in a different colour co ordinates

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

Answers (0)

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!