Can I have round corners with PATCH?
조회 수: 18 (최근 30일)
이전 댓글 표시
I use the following to create a rectangular box using PATCH,
patch([7 7 5 5], [5 7 7 5], 'r')
axis([0 10 0 10])
I want round corners. I have tried the property LineJoin but it does not do anything.
h.LineJoin = 'round';
So is this possible?
댓글 수: 0
채택된 답변
추가 답변 (1개)
Les Beckham
2022년 3월 22일
편집: Les Beckham
2022년 3월 22일
Try this. Adjust the 'curvature' value to adjust the ratio of the round corners to the size of the rectangle (1.0 will result in a circle).
rectangle('position', [5 5 2 2], 'curvature', 0.2, 'facecolor', 'r')
axis equal
axis([0 10 0 10])
댓글 수: 4
Les Beckham
2022년 3월 22일
You are welcome.
I did too! I wasn't aware of polyshape or polybuffer. Apparently those were added during the several years that I didn't have a copy of Matlab.
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!