%% Add Text to Geographic Plot
% Plot a straight line between two points on a map. Specify the endpoints of the line using the coordinates of Seattle and Anchorage. Specify latitude and longitude in degrees.

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;

%
% Plot the data using geoplot. Customize the appearance of the line using the line specification 'g-*'. Adjust the latitude and longitude limits of the map using geolimits.

geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*')
geolimits([45 62],[-149 -123])

%
% Identify Anchorage using the text function.

text(latAnchorage,lonAnchorage,'Anchorage');

%
% Identify Seattle using the text function. Adjust the alignment of the text label by specifying properties of the Text object.

text(latSeattle,lonSeattle,'Seattle',...
    'HorizontalAlignment','right',...
    'VerticalAlignment','bottom');

%
% Copyright 2018 The MathWorks, Inc.