Label coordinates on a map

2 ビュー (過去 30 日間)
Rhys Milford
Rhys Milford 2019 年 3 月 2 日
コメント済み: Rhys Milford 2019 年 3 月 3 日
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!

採用された回答

Walter Roberson
Walter Roberson 2019 年 3 月 2 日
  1 件のコメント
Rhys Milford
Rhys Milford 2019 年 3 月 3 日
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')

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by