
How to write name inside polygon?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ZeKkEn NoName
am 20 Jan. 2021
Kommentiert: Star Strider
am 21 Jan. 2021
After create a polygon how to write name inside it so you can differeniate between it and the other polygons?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 20 Jan. 2021
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!