How to remove horizontal lines as plotting 0-360 degree map
조회 수: 4 (최근 30일)
이전 댓글 표시
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/643335/image.png)
Coast=load('Coast.mat');
X=Coast.long;
Y=Coast.lat;
X(X<=0)=X(X<=0)+360;
plot(X,Y);
댓글 수: 2
답변 (3개)
wentao ma
2021년 12월 1일
coastlon(abs(diff(coastlon))>180+1)=nan;
댓글 수: 1
Cristina Radin
2022년 2월 2일
Hi! You are right, thank you!
The complete code:
load coastlines
coastlonWrapped = wrapTo360(coastlon);
index=abs(diff(coastlonWrapped))>180+1;
pos=find(index==1) %to be sure
coastlonWrapped(pos)=NaN;
plot(coastlonWrapped,coastlat)
SALAH ALRABEEI
2021년 6월 6일
Make sure to clear the figure before plotting because the coast.mat does not have these lines.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!