How to make contour smooth
Show older comments
Please, how can I smooth a contour better than the one I attached. The main data is the .xlsx file
X =linspace(-0.3, 0.3, 51);
Y = linspace(0, 3, 51);
Accepted Answer
More Answers (2)
Image Analyst
on 20 Aug 2023
John D'Errico
on 20 Aug 2023
Edited: John D'Errico
on 20 Aug 2023
0 votes
As others have pointed out, you don't want to try to make the contours smooth AFTER the fact. Instead you want to smooth the surface in advance, THEN build your contours from the smoothed matrix. This will be a better solution. What method of smoothing you employ is a difficult choice, especially since the surface you have appears to have very sharp curvature in places. That will make it difficult no matter what you choose.
3 Comments
Bruno Luong
on 20 Aug 2023
Image Analyst
on 21 Aug 2023
Yes, but @John D'Errico and I believe he doesn't want an edge preserving filter. It's the edges that are giving rise to a blocky edges/outlines. What you want is a blurring filter so the edges will be smoother. But actually I'm not sure why he wants them to be smoother anyway. @University What's wrong with the original, more accurately placed contour lines? Why smooth them out? I don't think it's necessary unless you just like smoother lines for aesthetic reasons.
Again, seeing the original image would help. Please post it.
Bruno Luong
on 21 Aug 2023
Edited: Bruno Luong
on 21 Aug 2023
@Image Analyst Anisotropic diffussion filter will smooth the data along the edge and keep the normal derivative significantly unchanged. Edge preserving filter will smooth the contours while keeping the density (high at the edge) unmodified. That is exactly what it needs, I think.
Categories
Find more on Contour 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!


