버전 1.4 (585 KB) 작성자: Chad Greene
label data directly on a plot
다운로드 수: 4.7K
업데이트 날짜: 2015/2/2

라이선스 보기

An alternative to text, legend, or annotation commands, this function allows you to label objects directly on a plot by entering the handle of a plotted object and a string. Label text is automatically colored to match plotted data, or text color can be entered manually.
h = label(...)

label(h,'string') places 'string' near the leftmost data described by handle h.

label(...,'location',LocationString) specifies location of the string. LocationString can be any of the following:

'left' or 'west' (default)
'right' or 'east'
'top' or 'north'
'bottom' or 'south'
'center' or 'middle'

label(...,'TextProperty',PropertyValue) specifies text properties as name-value pairs.

label(...,'slope') attempts to angle text following the local slope of the data.

htext = label(...) returns the handle htext of the newly-created text object.

인용 양식

Chad Greene (2024). label (, MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
Help CenterMATLAB Answers에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!


버전 게시됨 릴리스 정보

Updated for R2014b and fixed aspect ratio as per Simon Tardivel's suggestion. Thanks Simon and another FEX user Matthias for pointing out the R2014b bug.

A bug fix related to finding label pinning points. New examples added.

typo fix

Improved input/error checking.