Info

This question is closed. Reopen it to edit or answer.

How can i plot coordinate point in mutiple color?

1 view (last 30 days)
Untitled2.png
i need to plot this coordinate in different color. i assume that column1,2,3 is x,y,z axis
If value in y is in 0.0024<x<0.0032 it will keep data in x y and z and show green.
If value in y is less than 0.0024 it will keep data in x y and z and show red.
If value in y is more than 0.0032 it will keep data in x y and z and show blue.
now i use pcshow function and i cant seperate color in different point of data.
Untitled3.png

Answers (1)

KSSV
KSSV on 8 Feb 2020
x = rand(100,1) ;
y = rand(100,1) ;
figure
hold on
plot(x(y<=0.4),y(y<=0.4),'*r')
plot(x(y>0.4&y<0.7),y(y>0.4&y<0.7),'*b')
plot(x(y>=0.7),y(y>=0.7),'*g')
Also read about scatter, gscatter.

Community Treasure Hunt

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

Start Hunting!