Main Content

rotatetext

Rotate text to projected graticule on axesm-based map

Syntax

rotatetext
rotatetext(objects)
rotatetext(objects,'inverse')

Description

rotatetext rotates displayed text objects to account for the curvature of the graticule. The objects are selected interactively from a graphical user interface.

rotatetext(objects) rotates the selected objects. objects can be a name recognized by handlem or a vector of handles to displayed text objects.

rotatetext(objects,'inverse') removes the rotation added by an earlier use of rotatetext. If omitted, 'forward' is assumed.

Examples

Add text to a map and rotate the text to the graticule.

figure
worldmap('south america')
geoshow('landareas.shp','facecolor','yellow')
cities = shaperead('worldcities.shp', 'UseGeoCoords', true); 
Santiago = strcmp('Santiago',{cities(:).Name});
h=textm(cities(Santiago).Lat, cities(Santiago).Lon, ...
     'Santiago');
rotatetext(h)

Map of South America containing a text label for Santiago. The text is rotated slightly to match the curvature of the graticule.

Tips

You can rotate meridian and parallel labels automatically by setting the LabelRotation property of the axesm-based map to 'on'.

Version History

Introduced before R2006a

See Also

|