I want to remove the zeros from the P matrix so the that they have transparent color on Scatter3 plot. I tried P(P==0)=NaN but the data still has a blue color. How do I set zero data (blue) to transparent color.
[x,y,z] = meshgrid(1:50,1:200,1:200); scatter3(y(:),z(:),x(:),5, P(:) ,'marker','.')

 채택된 답변

Jan
Jan 2017년 12월 10일
편집: Jan 2017년 12월 10일

1 개 추천

What is "transparent color"? Do you want the points to vanish? Then:
[x,y,z] = meshgrid(1:50,1:200,1:200);
keep = (P(:) ~= 0);
x = x(keep);
y = y(keep);
z = z(keep);
scatter3(y(:), z(:), x(:), 5, P(:) ,'marker', '.')

댓글 수: 1

Ahmad Alzahrani
Ahmad Alzahrani 2017년 12월 10일
yes, that what I was looking for. Thank you, I appreciate your time.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

질문:

2017년 12월 10일

댓글:

2017년 12월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by