MATLAB Examples

Customize Layout of Geographic Axes

This example shows how to customize the layout of a Geographic Axes.

Plot a line between two cities using the geoplot function.

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'b:')

Make the plot take up the entire space inside the figure, turn off the grid, and turn off tick marks.

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

  GeographicAxes with properties:

     Basemap: 'darkwater'
    Position: [0.1300 0.1100 0.7750 0.8150]
       Units: 'normalized'

  Use GET to show all properties


gx = 

  GeographicAxes with properties:

     Basemap: 'darkwater'
    Position: [0.1300 0.1124 0.7750 0.8126]
       Units: 'normalized'

  Use GET to show all properties


gx = 

  GeographicAxes with properties:

     Basemap: 'darkwater'
    Position: [0 0 1 1]
       Units: 'normalized'

  Use GET to show all properties