Main Content

tightmap

Remove white space around axesm-based map

Syntax

tightmap

Description

tightmap sets the axis limits to be tight around the map in the current axes. This eliminates or reduces the white border between the map frame and the axes box. Use axis auto to undo tightmap.

Examples

collapse all

Display a map of Africa. Notice the white space between the map frame and the edge of the axes box.

axesm('miller','maplatlim',[-40 40],'maplonlim',[-20 60])
framem; 
gridm; 
mlabel; 
plabel
load coastlines
plotm(coastlat,coastlon)

Now remove white space around the map.

tightmap

Tips

The axis limits are fixed. If a change in the projection parameters changes the size or position of the map display within the projected coordinate system, execute tightmap again. Also note that tightmap needs to be re-applied following any call to setm that causes projected map objects to be re-projected.

The tightmap function performs no action on a 'globe' axesm-based map.

Version History

Introduced before R2006a