
How to use patch/fill on a polarplot
조회 수: 34 (최근 30일)
이전 댓글 표시
Hi all
I can't seem to get this right, so I figure I better ask someone with more experience:
How do I use patch/fill to fill in a polygon in a polarplot setting?
Based on the example listed in the help for polarplot: How do I fill in this triangle with e.g. the color red?
t = 0 :pi/1.5: 2*pi;
pp=polarplot(t, sin(2*t).*cos(2*t), '--r');

댓글 수: 0
채택된 답변
Divyajyoti Nayak
2025년 6월 18일
From MATLAB R2025a, the 'patch' function now works on polar axes. Here's some sample code for it and the documentation to help out:
clc
clear
p = polaraxes;
r = [0;1;1];
theta = [0;pi/3;2*pi/3];
patch(p,theta,r,'red');

댓글 수: 1
Adam Danz
2025년 9월 30일 13:03
Read more about polar patches and surface: https://blogs.mathworks.com/graphics-and-apps/2025/09/30/polar-plots-with-patches-and-surfaces-r2025a/
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!