How to remove horizontal lines as plotting 0-360 degree map
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen

Coast=load('Coast.mat');
X=Coast.long;
Y=Coast.lat;
X(X<=0)=X(X<=0)+360;
plot(X,Y);
2 Kommentare
Antworten (3)
wentao ma
am 1 Dez. 2021
coastlon(abs(diff(coastlon))>180+1)=nan;
1 Kommentar
Cristina Radin
am 2 Feb. 2022
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
am 6 Jun. 2021
Make sure to clear the figure before plotting because the coast.mat does not have these lines.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Geographic Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!