How I can add marker names with plot function?

조회 수: 13 (최근 30일)
sermet
sermet 2016년 5월 5일
답변: Alessandro Masullo 2016년 5월 5일
station_id={'abcd','brmu','vcfd','mnnn'};
lon = [ 2.3349 12.878 8.6649 13.066 ];
lat = [ 48.835 49.1442 50.0906 52.3792 ];
plot(lon,lat,'.r','MarkerSize',20,'Marker','o', 'MarkerFaceColor', 'blue')
xlabel('Longtitude')
ylabel('Latitude')
title('STATIONS')
I need to add "station_id" for each marker in the plot figure.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 5일
편집: Azzi Abdelmalek 2016년 5월 5일
for k=1:numel(station_id)
text(lon(k)+0.5,lat(k),station_id{k})
end

추가 답변 (1개)

Alessandro Masullo
Alessandro Masullo 2016년 5월 5일
You can use the function text

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by