How to remove horizontal lines as plotting 0-360 degree map
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens

Coast=load('Coast.mat');
X=Coast.long;
Y=Coast.lat;
X(X<=0)=X(X<=0)+360;
plot(X,Y);
2 commentaires
Réponses (3)
wentao ma
le 1 Déc 2021
coastlon(abs(diff(coastlon))>180+1)=nan;
1 commentaire
Cristina Radin
le 2 Fév 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
le 6 Juin 2021
Make sure to clear the figure before plotting because the coast.mat does not have these lines.
2 commentaires
Voir également
Catégories
En savoir plus sur Geographic Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!