필터 지우기
필터 지우기

Scatter points with a colormap based on distances

조회 수: 15 (최근 30일)
Francesca Danielli
Francesca Danielli 2022년 10월 2일
댓글: KSSV 2022년 10월 2일
Hi! I have a first set of N points (each of them is identified by the three coordinates) and I have projected them on a plane (identified by a,b,c,d parameters). For each point, I calculated the distance from the plane and the coordinates of the point projected on the plane. Now I'd like to plot (scatter) the projected points on the plane according to a color map that accounts for the calculated distance..any suggestion? Thank you!

채택된 답변

KSSV
KSSV 2022년 10월 2일
You can use scatter3.
x = rand(10,1) ;
y = rand(10,1) ;
z = rand(10,1) ;
d = rand(10,1) ;
scatter3(x,y,z,[],d,'filled')
colormap(jet)
colorbar
  댓글 수: 3
Francesca Danielli
Francesca Danielli 2022년 10월 2일
thanks to both of you :)
I succeeded with the following
figure()
scatter3(px_0a_out , py_0a_out , pz_0a_out , 40 , distanza_0a , 'filled')
xlabel('x')
ylabel('y')
zlabel('z')
axis equal
colormap(jet());
h = colorbar;
h.Limits=[0 max(distanza_0a)]; % set(h, 'ylim', [0 max(distanza_0a)])
title(h, 'Protrusion')
KSSV
KSSV 2022년 10월 2일
Thanks is accepting/ voting the answer. :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Purple에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by