How to scatter3 row vector with different colors

2 次查看(过去 30 天)
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 个评论
Chunru
Chunru 2021-7-27
scatter3 plot z vs x, y. What is your data vector?
Norsalina Hassan
Norsalina Hassan 2021-7-27
This is what I did before
scatter3(OMEGA(1,:), OMEGA(2,:), OMEGA(3,:),'b*'), but i need each row to be different colors

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2021-7-27
编辑:KSSV 2021-7-27
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,'.');

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by