why does the surf command give me this result?

1 回表示 (過去 30 日間)
Valeria Leto
Valeria Leto 2021 年 10 月 9 日
回答済み: yanqi liu 2021 年 10 月 10 日
Hi! I got this image with
surf(est,nord,down,I_frame,'EdgeColor','none')
where (est,nord) are not regular points.
I know for sure that there are brighter points for example in the region est=(30,40), nord=(-50,-55), but it seems that the darker points preveal over the brigth ones and only them are plotted. Any ideas why this happen? Thank you
  2 件のコメント
Star Strider
Star Strider 2021 年 10 月 9 日
One optiion could be to add a 'FaceAlpha' value —
surf(est,nord,down,I_frame,'EdgeColor','none', 'FaceAlphs',0.5)
That would make all of them semi-transparent, allowing those that are otherwise ‘covered’ to be seen. Change that value (going from 0 to 1) to get the desired result.
.
Valeria Leto
Valeria Leto 2021 年 10 月 9 日
Hi @Star Strider I got this image with Face Alpha 0.5. The problem is that I would like only one value, the brigther one. I would like to select it and generate a new image.

サインインしてコメントする。

回答 (2 件)

Star Strider
Star Strider 2021 年 10 月 9 日
I have no idea what the data are, or how the data are being plotted.
If the colormap is gray the ‘brighter’ values are higher ‘z’ values. If those are the ones to be separated and plotted, set a suitable threshold and only plot the data above the threshold. The easiest way to do that is to set all the values below the threshold to NaN.
Example —
v = linspace(-5, 5, 25);
[X,Y] = ndgrid(v);
Z = exp(-(X.^2+Y.^2)*0.1);
figure
surf(X, Y, Z)
colormap(turbo)
title('Original')
figure
surf(X, Y, Z, 'EdgeColor','none', 'FaceAlpha',0.5)
colormap(gray)
view(0,90)
title('Original, Gray Scale, Top View')
Znew = Z;
Znew(Znew<0.5) = NaN; % Set Values Below Threshold To 'NaN' So That They Will Not Plot
figure
surf(X, Y, Znew)
colormap(gray)
view(0,90)
title('Bright Areas')
Experiment to get the desired result.
.

yanqi liu
yanqi liu 2021 年 10 月 10 日
sir, may be use some colormap type to display, such as
colomap hsv

カテゴリ

Help Center および File ExchangeRed についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by