Label coordinates on a map

3 visualizaciones (últimos 30 días)
Rhys Milford
Rhys Milford el 2 de Mzo. de 2019
Comentada: Rhys Milford el 3 de Mzo. de 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!

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Mzo. de 2019
  1 comentario
Rhys Milford
Rhys Milford el 3 de Mzo. de 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')

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by