how to smooth the corners of a map

조회 수: 1 (최근 30일)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021년 11월 9일
편집: Chunru 2021년 11월 9일
I have a map of this type generated with the command "contourf(XX,YY,ZZ);" where XX is the longitude value, YY is the latitude value and ZZ is the data to be entered. This map with the different colors is created based on a grid of points that are spaced from each other by one degree of latitude and one degree of longitude. For this reason, in some cases, the limits of these maps are very clear.
I wanted to ask : is there a way to create smoother edges? to make the limits of colors more curvilinear...
thanksss

채택된 답변

Chunru
Chunru 2021년 11월 9일
You can interpolate the data first before using contourf. For example, you can use scatteredInterpolant (with method "natural) if your grid is irregular; Or you can use griddedInterpolant (which has more exotic interpolation methods).
  댓글 수: 2
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA 2021년 11월 9일
oook, but I tried to use:
asmooth=scatterInterpolant(XX,YY,ZZ); XX-YY-ZZ are all 41x41 double
contourf(asmooth);
and I get this error "The input points must be specified in column-vector format."
how can I do?
Chunru
Chunru 2021년 11월 9일
편집: Chunru 2021년 11월 9일
Do you have regular or irregular grids? Show some data of your XX and YY. Or you can try
asmooth=scatterInterpolant(XX(:),YY(:),ZZ(:))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by