removing zero data from Scatter3 figure

4 ビュー (過去 30 日間)
Ahmad Alzahrani
Ahmad Alzahrani 2017 年 12 月 10 日
コメント済み: Ahmad Alzahrani 2017 年 12 月 10 日
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 日
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 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by