why does the surf command give me this result?
2 views (last 30 days)
Hi! I got this image with
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
Star Strider on 9 Oct 2021
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.
v = linspace(-5, 5, 25);
[X,Y] = ndgrid(v);
Z = exp(-(X.^2+Y.^2)*0.1);
surf(X, Y, Z)
surf(X, Y, Z, 'EdgeColor','none', 'FaceAlpha',0.5)
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
surf(X, Y, Znew)
Experiment to get the desired result.