how can I add label to rectangle object ?

조회 수: 25 (최근 30일)
safa BY
safa BY 2018년 8월 3일
댓글: Eduard Reitmann 2018년 8월 6일
My code : rect=rectangle('Position',pos);
draggable(rect); set(rect,'FaceColor','none','EdgeColor','g','LineWidth',6);
And now I want to add a label to the rectangle

답변 (1개)

Eduard Reitmann
Eduard Reitmann 2018년 8월 3일
I am not familiar with the 'draggable' function, but this should give you a text box in the middle of the square.
text(pos(1)+pos(3)/2,pos(2)+pos(4)/2,'Title','HorizontalAlignment','center')
  댓글 수: 4
safa BY
safa BY 2018년 8월 6일
thanks a lot
Eduard Reitmann
Eduard Reitmann 2018년 8월 6일
You are welcome. I hope it solved your problem.

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by