Borrar filtros
Borrar filtros

How to Add an Alphanumeric Character to a Shape?

1 visualización (últimos 30 días)
Rightia Rollmann
Rightia Rollmann el 5 de Feb. de 2017
Editada: Stephen23 el 5 de Feb. de 2017
How can I add the number “1” in the middle of the circle below?
r = rectangle('Position', [2 3 5 5], 'Curvature', 1, 'FaceColor', 'g'); axis equal;

Respuesta aceptada

Stephen23
Stephen23 el 5 de Feb. de 2017
Editada: Stephen23 el 5 de Feb. de 2017
Use text:
>> pos = [2,3,5,5];
>> r = rectangle('Position',pos, 'Curvature',1, 'FaceColor','g'); axis equal;
>> text(pos(1)+pos(3)/2,pos(2)+pos(4)/2, '1', 'FontSize',24,...
'HorizontalAlignment','center','VerticalAlignment','middle')

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by