MATLAB: Is there any way I can make the attached contour plots more smooth

contour plotsimage processingmatlab plotssavitzky-golaySignal Processing Toolboxsmoothening the plots

I have attached two contour plots for pressure field outside an ellipse. The contour plots I got are jagged, may be due to the numerical integration I am using to calculate the pressure fields.The two plots are with Gaussian points 15000 and 5000 respectively. It is observable that with more Gaussian points, the contour plots are becoming smooth, but it is also taking time. Is there any other way to get smooth contour lines.

Best Answer

Sorry. If you try to resize a matrix (using interpolation) that is not itself sufficiently smooth that the original matrix yields non-smooth contours, you will get more finely interpolated noise! Interp2 is a waste of time here.
If you have a noisy matrix, then BEFORE you compute contours, you MUST smooth it FIRST if you want smooth contours. That smoothing may be done by removing the noise before you create the matrix, thus noise reduction prior to creating the matrix of data. Or you can do smoothing by applying a smoothing tool to your matrix, after creation.
You are doing some form of numerical integration that creates a noisy result. So a higher precision numerical integration is an option. Noise in the integration, as well as your comments, suggests you might be doing a Monte Carlo integration. I can't help if you don't say.
If you must do post smoothing on the matrix, then the classic solution is simply to apply a Gaussian blur to the matrix. You can do that using conv2. Or it should be possible to use methods like Savitsky-Golay, in two dimensions.
Related Question