Label coordinates on a map

2 vues (au cours des 30 derniers jours)
Rhys Milford
Rhys Milford le 2 Mar 2019
Commenté : Rhys Milford le 3 Mar 2019
I'm trying to create a basic map on the Apollo landing sites on the Moon. How can I create labels to go with the markers?
clear
load moonalb
apollo=load('lunar coord.txt');
figure
axesm ortho
geoshow(moonalb,moonalbrefvec,'DisplayType','texturemap')
colormap(gray(256))
axis off
plotm(apollo(:,1),apollo(:,2),'ro','markerfacecolor','w')
title('Apollo landing sites')
I've included the coordinates text.
Thanks!

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Mar 2019
  1 commentaire
Rhys Milford
Rhys Milford le 3 Mar 2019
I had difficulty setting the color, but it's actually simpler than I thought, so if anyone is interested here's how it works.
clear
load moonalb
apollo=load('lunar coord.txt');
figure
axesm ortho
geoshow(moonalb,moonalbrefvec,'DisplayType','texturemap')
colormap(gray(256))
axis off
plotm(apollo(:,1),apollo(:,2),'ro','markerfacecolor','w')
textm(apollo(1,1),apollo(1,2),'Apollo 11','color','w')
textm(apollo(2,1),apollo(2,2),'Apollo 12','color','w')
textm(apollo(3,1),apollo(3,2),'Apollo 14','color','w')
textm(apollo(4,1),apollo(4,2),'Apollo 15','color','w')
textm(apollo(5,1),apollo(5,2),'Apollo 16','color','w')
textm(apollo(6,1),apollo(6,2),'Apollo 17','color','w')
title('Apollo landing sites')

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by