How to adding label for rectangle

hello everyone.....
i used the function below for drawing rectangle item, now i want to add number for this item ( like number (1) ),if anyone have idea
thanks :-)
rectangle('Position',[x y Element(i).W Element(i).H],'FaceColor',cl(i,:));

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 11 月 1 日
編集済み: Walter Roberson 2020 年 11 月 1 日

0 投票

You could use text() or annotation() if you need the words to be near the rectangle.
You can use legend() if you want to create a legend. legend() can be used for all graphics objects, not just for plot()

1 件のコメント

ahmed noori
ahmed noori 2020 年 11 月 1 日
thank you so much ... text() was very fit.

サインインしてコメントする。

カテゴリ

質問済み:

2020 年 10 月 31 日

コメント済み:

2020 年 11 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by