textm

Project text annotation on map axes

Syntax

textm(lat,lon,string)
textm(lat,lon,z,string)
textm(lat,lon,z,string,PropertyName,PropertyValue,...)
h = textm(...)

Description

textm(lat,lon,string)projects the text instringonto the current map axes at the locations specified by thelatandlon. The units oflatandlonmust match the'angleunits'property of the map axes. Iflatandloncontain multiple elements,textmplaces a text object at each location. In this casestring可能是一个单元阵列的特征向量same number of elements aslatandlon. (For backward compatibility,stringmay also be a 2-D character array such that size(string,1)matchesnumel(lat)).

textm(lat,lon,z,string)draws the text at the altitude(s) specified inz, which must be the same size aslatandlon. The default altitude is 0.

textm(lat,lon,z,string,PropertyName,PropertyValue,...)sets the text object properties. All properties supported by the MATLAB®textfunction are supported bytextm.

h = textm(...)returns the handles to the text objects drawn.

Examples

The feature oftextmthat distinguishes it from the standard MATLABtextfunction is that the text object is projected appropriately. Type the following:

axesm sinusoid framem('FEdgeColor','red') textm(60,90,'hello')

figure; axesm miller framem('FEdgeColor','red') textm(60,90,'hello')

The text'hello'is placed at the same geographic point, but it appears to have moved relative to the axes because of the different projections. If you change the projection using thesetmfunction, the text moves as necessary. Usetextto fix text objects in the axes independent of projection.

Tips

You may be working with scalarlatandlondata or vectorlatandlondata. If you are in scalar mode and you enter a cell array of character vectors, you will get a text object containing multiple lines. Also note that vertical slash characters, rather than producing multiple lines of text, yield a single line of text containing vertical slashes. On the other hand, iflatandlonare nonscalar, then the size of the cell array input must match their size exactly.

See Also

|

Introduced before R2006a