How to scatter3 row vector with different colors
Show older comments
Hi,
I have 3 row vectors (3x510 double). I want to use different color for each row. How can I plot using scatter3 function?
Please help.
Thanks in advance.
2 Comments
Chunru
on 27 Jul 2021
scatter3 plot z vs x, y. What is your data vector?
Norsalina Hassan
on 27 Jul 2021
Answers (1)
LEt A be your 3*510 matrix.
x = A(1,:) ;
y = A(2,:) ;
z = A(3,:) ;
scatter(x,y,10,z,'.');
If you want to use scatter3.
scatter3(x,y,z,100,z,'.');
2 Comments
Norsalina Hassan
on 28 Jul 2021
KSSV
on 28 Jul 2021
Thanks is accepting/ voting the answer.
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!