How to smooth this contourf plot?
조회 수: 78 (최근 30일)
이전 댓글 표시
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
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.
채택된 답변
Mathieu NOE
2022년 3월 23일
hello
with this FEx submission, you should be happy now
DATA2 = smooth2a(DATA1,10,10); % adapt the smoothing amount to your needs...
figure(2)
h2=contourf(X1,X2,DATA2,'edgecolor','none');
results
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!