MATLAB Answers

How to remove horizontal lines as plotting 0-360 degree map

8 views (last 30 days)
Thao Linh Tran
Thao Linh Tran on 6 Jun 2021
Commented: Thao Linh Tran on 6 Jun 2021
Hi, I am using following codes to plot a 0-360 degree map, can anyone please help to show me how to remove the horizontal lines on the map created. Athough plot(X,Y,'.') does not show those lines, I wanted to plot the coastlines instead of points. Thanks in advance!
Coast=load('Coast.mat');
X=Coast.long;
Y=Coast.lat;
X(X<=0)=X(X<=0)+360;
plot(X,Y);
  2 Comments

Sign in to comment.

Answers (2)

KSSV
KSSV on 6 Jun 2021
Edited: KSSV on 6 Jun 2021
Coast=load('Coast.mat');
X=Coast.long;
Y=Coast.lat;
% X(X<=0)=X(X<=0)+360;
X = X+180 ; Y = Y+180 ;
plot(X,Y);
  5 Comments
Thao Linh Tran
Thao Linh Tran on 6 Jun 2021
But the Western North Pacific is splitted into two parts by that way.

Sign in to comment.


SALAH ALRABEEI
SALAH ALRABEEI on 6 Jun 2021
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!

Translated by