How to write name inside polygon?

9 vues (au cours des 30 derniers jours)
ZeKkEn NoName
ZeKkEn NoName le 20 Jan 2021
Commenté : Star Strider le 21 Jan 2021
After create a polygon how to write name inside it so you can differeniate between it and the other polygons?

Réponse acceptée

Star Strider
Star Strider le 20 Jan 2021
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 commentaires
ZeKkEn NoName
ZeKkEn NoName le 21 Jan 2021
Thanks
Star Strider
Star Strider le 21 Jan 2021
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Elementary Polygons dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by