The surface I'm plotting comes out jagged and "saw teeth" like
65 views (last 30 days)
Show older comments
the surface I plot, using Surf command comes out pointy and jagged, and it ruines the visual presentation and creates an illution the data is spoiled.
I checked the points via contour and saw that the data is fine - the outpoot is smooth and there are no NaN values.
I also tried trisurf function.
Is there a solution? Or is it just a bug I have to deal with?
the good side:

the bad side:

thank you very much!
3 Comments
Star Strider
on 21 Dec 2025 at 16:05
I am not certain what the problem is.
One option would be to interpolate the matrices to finer grids (or at least different grids, depending on what the problem is), and using an interpolation method other than 'linear'. MATLAB has several matrix interpolation functions that could make this straightforward.
Accepted Answer
Matt J
on 24 Dec 2025 at 10:46
Edited: Matt J
on 24 Dec 2025 at 10:55
It's a very coarsely sampled surface. There's not really any more to it. You can bicubicly upsample the data if you want a smoother appearance:
load stuff
figure;
S = surf(x,y,h,'EdgeAlpha',0.3);
view(-84,84)
figure;
H=interp2(h,3,'bicubic') ;
X=linspace(x(1), x(end),width(H));
Y=linspace(y(1), y(end),height(H));
surf(X,Y,H,'EdgeAlpha',0.3)
view(-84,84)
2 Comments
Matt J
on 24 Dec 2025 at 18:06
Show us. With bicubic interpolation, that should be possible only if the data is piecewise linear over a broad swath of samples in the region of the pointy edge.
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
