How to write name inside polygon?

5 ビュー (過去 30 日間)
ZeKkEn NoName
ZeKkEn NoName 2021 年 1 月 20 日
コメント済み: Star Strider 2021 年 1 月 21 日
After create a polygon how to write name inside it so you can differeniate between it and the other polygons?

採用された回答

Star Strider
Star Strider 2021 年 1 月 20 日
Use the text function.
Try this:
pgon = polyshape([1 3 5 7],[2 6 4 1]);
[xc,yc] = centroid(pgon);
figure
plot(pgon)
axis('equal')
text(xc,yc, sprintf('Polygon with centroid (%.2f, %.2f)', xc, yc), 'HorizontalAlignment','center', 'VerticalAlignment','middle')
producing:
.
  2 件のコメント
ZeKkEn NoName
ZeKkEn NoName 2021 年 1 月 21 日
Thanks
Star Strider
Star Strider 2021 年 1 月 21 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Polygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by