I'm trying to use the text() function to display a checkmark in a figure. I can't seem to figure it out. I've basically tried:
text(x,y,'✓')
It doesn't display anything using this command. Help!

 채택된 답변

José-Luis
José-Luis 2013년 1월 14일

1 개 추천

First set your system to display UTF-8 encoded characters:
feature('DefaultCharacterSet','UTF-8');
Then plot it (look for UTF-8 characters for other types of check marks):
uicontrol('Style','text', 'String',char(hex2dec('2713')), ...
'Units','normalized', 'Position',[0 0 1 1], ...
'FontSize',30)
I don't know if it is possible to do with text()

댓글 수: 1

Justin Solomon
Justin Solomon 2013년 1월 14일
Thanks, doesn't seem to work with text() but I got it to work with uicontrol().

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Thorsten
Thorsten 2013년 1월 14일

0 개 추천

try a different text
text(x, y, 'ok')
and make sure that x and y are within the bounds of your figure

댓글 수: 2

Justin Solomon
Justin Solomon 2013년 1월 14일
Thanks for the suggestion. I tried this and my x,y are within the bounds. It just doesn't like the ✓ character it seems. I think I may just use * instead and avoid the trouble.
Bilal qureshi
Bilal qureshi 2018년 6월 30일
its not working and how to make Cross like 'X' ??

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기

질문:

2013년 1월 14일

댓글:

2018년 6월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by