textborder - Higher contrast text using a 1-pixel-thick border

버전 1.2.0.0 (1.73 KB) 작성자: Joao Henriques
Draws text on a figure with a 1-pixel-thick border.
다운로드 수: 1.7K
업데이트 날짜: 2010/4/28

라이선스 보기

This function draws text on a figure with a 1-pixel-thick border, which may be useful when simple text would be hard to read due to low contrast.

TEXTBORDER(X, Y, STRING)
Creates text on the current figure with a one-pixel border around it. The default colors are white text on a black border, which provides high contrast in most situations.

TEXTBORDER(X, Y, STRING, TEXT_COLOR, BORDER_COLOR)
Optional TEXT_COLOR and BORDER_COLOR specify the colors to be used.

Optional properties for the native TEXT function (such as 'FontSize') can be supplied after all the other parameters.
Since usually the units of the parent axes are not pixels, resizing it may subtly change the border of the text out of position. Either set the right size for the figure before calling TEXTBORDER, or always redraw the figure after resizing it.

---

The screenshot was created using the following code. (The image is part of the Matlab Image Processing Toolbox demos.)

imshow(imresize(imread('pears.png'), 0.5))
textborder(35, 215, 'Some text')
textborder(120, 100, 'Some text','w','k','FontSize',22)
textborder(270, 215, 'Some text',[0.7 0.8 1])

인용 양식

Joao Henriques (2025). textborder - Higher contrast text using a 1-pixel-thick border (https://www.mathworks.com/matlabcentral/fileexchange/27383-textborder-higher-contrast-text-using-a-1-pixel-thick-border), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2008b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Audio and Video Data에 대해 자세히 알아보기
도움

도움 준 파일: Smith Chart with Real Time Data.

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Changed the example and screenshot to more clearly demonstrate usage.

1.0.0.0