Customize Layout of Geographic Axes

Customize the layout of a geographic axes by modifying its properties.

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 'b:'. Adjust the latitude and longitude limits of the map using geolimits.

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

Customize the layout of the axes. Turn off the grid, stretch the grid to take up the entire figure, and turn off tick marks by modifying the Grid, Position, and TickDir properties.

gx = gca;
gx.Grid = 'off';
gx.TickDir = 'out';
gx.Position = gx.OuterPosition;

See Also

Related Topics