
How to write name inside polygon?
조회 수: 6 (최근 30일)
이전 댓글 표시
After create a polygon how to write name inside it so you can differeniate between it and the other polygons?
댓글 수: 0
채택된 답변
Star Strider
2021년 1월 20일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Elementary Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!