Plotting a line in a worldmap

4 vues (au cours des 30 derniers jours)
OSBORN AGYEI
OSBORN AGYEI le 19 Jan 2017
Commenté : OSBORN AGYEI le 19 Jan 2017
Dear all. I am trying plot a satellite track in the form of a line over lake Michigan. I loaded world map and then tried plotting the track (vectors X_47 and Y_47) but it didnt show up as a line. This may be because its coordinate is different. Pls help me
worldmap([41 47], [-89 -84]) lakes=shaperead('worldlakes','UseGeoCoords',true); X_47=(41.709091:0.5:43.127372);Y_47=(-87.476139:0.5:-86.340273); griddata(42.419908, -86.91495,1); load coastlines plotm(coastlat,coastlon); plotm(coastlat,coastlon);
hold on; plot(X_47,Y_47,'r');

Réponse acceptée

mizuki
mizuki le 19 Jan 2017
With PLOTM, you need to define the map axes first like:
load coastlines
axesm sinusoid;
plotm(coastlat,coastlon);
but GEOSHOW is much easier to use than PLOTM:
worldmap([41 47], [-89 -84])
lakes=shaperead('worldlakes','UseGeoCoords',true);
X_47=(41.709091:0.5:43.127372);
Y_47=(-87.476139:0.5:-86.340273);
% griddata(42.419908, -86.91495,1);
load coastlines
geoshow(coastlat,coastlon);
hold on;
h = geoshow(X_47',Y_47');
h.Marker = 'o'; h.Color = 'r';
  1 commentaire
OSBORN AGYEI
OSBORN AGYEI le 19 Jan 2017
Thanks a lot

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by