Label coordinates on a map

3 views (last 30 days)
Rhys Milford
Rhys Milford on 2 Mar 2019
Commented: Rhys Milford on 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!

Accepted Answer

Walter Roberson
Walter Roberson on 2 Mar 2019
  1 Comment
Rhys Milford
Rhys Milford on 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')

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!