Display checkmark string in figure

14 visualizaciones (últimos 30 días)
Justin Solomon
Justin Solomon el 14 de En. de 2013
Comentada: Bilal qureshi el 30 de Jun. de 2018
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!

Respuesta aceptada

José-Luis
José-Luis el 14 de En. de 2013
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 comentario
Justin Solomon
Justin Solomon el 14 de En. de 2013
Thanks, doesn't seem to work with text() but I got it to work with uicontrol().

Iniciar sesión para comentar.

Más respuestas (1)

Thorsten
Thorsten el 14 de En. de 2013
try a different text
text(x, y, 'ok')
and make sure that x and y are within the bounds of your figure
  2 comentarios
Justin Solomon
Justin Solomon el 14 de En. de 2013
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 el 30 de Jun. de 2018
its not working and how to make Cross like 'X' ??

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by