How to smooth this contourf plot?
显示 更早的评论
Hello everyone,
I want to plot smooth contour filled data with the given data. I have tried this code.
h1=contourf(X1,X2,DATA1,'edgecolor','none');
shading interp;
with this I am getting this plot. But I want a smooth plot. I would really appreciate your help. Thanks in advance.
7 个评论
DGM
2022-3-23
That blockiness is in the data itself -- or at least the data that's attached.
Subhodh Sharma
2022-3-23
Adam Danz
2022-3-23
Bjorn Gustavsson
2022-3-23
If it is appropriate you could try some simple smoothing filtering:
h1=contourf(X1,X2,imfilter(ans,conv2(ones(3)/3^3,ones(5)/5^2,'full')),'edgecolor','none');
But if that is appropriate is for you to decide - for this simple case the northeastern part of India gets cut-off due to the width of the filter-kernel compared to how many pixels worth of data you have finite data in that region.
Subhodh Sharma
2022-3-23
Subhodh Sharma
2022-3-23
Bjorn Gustavsson
2022-3-23
The underlying problem might be the data you have in DATA1, if I simply do:
imagesc(DATA1)
and zoom in on the Kashmir(?) region it looks very peculiar, some kind of mixture between rasterized data and interpolated data on varying spatial resolution. The answer by Mathieu below looks nice to my eyes, if they are a suitable presentation of the data is for you to judge.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
