Label coordinates on a map

3 Ansichten (letzte 30 Tage)
Rhys Milford
Rhys Milford am 2 Mär. 2019
Kommentiert: Rhys Milford am 3 Mär. 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!

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Mär. 2019
  1 Kommentar
Rhys Milford
Rhys Milford am 3 Mär. 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')

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by