If you sample your polar plot densely enough, the you can use patch. It will not be an exact fill but it may look almost filled.
Please do
help patch
Best.
"yaya yoyo" <matl...@walla.co.il> wrote in message <hljg5a$qd3$1...@fred.mathworks.com>...
h = polar([pi/6,pi/5],[1 2]);
paxis = get(h,'Parent');
paxchild = allchild(paxis);
ppatch = paxchild(end);
ppatch will now be the handle of a patch which is the circle of the polar
plot. You can get the patch's XData and YData properties in order to retrieve
the *cartesian* coordinates of the circle (relative to the axis). The
coordinates are counter-clockwise starting from the right-most point on the
circle (x = whatever, y = 0). There will probably be 101 coordinates, with the
last pair being the same as the first. If you have angle alpha degrees, then
it will touch the circle between pairs floor(1 + 100 * alpha / 360) and
ceil(1 + 100 * alpha / 360). You could interpolate the coordinates if you feel
enthusiastic.
With this information, you can create a patch from (0,0) to the first
(counter-clockwise) point, then copy the points from the patch until you reach
the last exact point, then add your interpolated final point, then close back
to (0,0).
Warning: if you are using the OpenGL renderer, in order for the second patch
to appear on top of the patch that is the circle, you must give the second
patch a Z value that is greater than the (implicit 0) Z value of the
background circle. It doesn't matter which of the patches is drawn "first",
and manipulating the axis Children order or using uistack() will not change
this behavior: it is a property of OpenGL that items in the same Z plane are
internally rendered in a specific order.
angle = [0,0,pi/2];
radius = [0, 2, 2];
h = polar(angle,radius);
It is a triangle on a polar plot. How do you fill this triangle with color?
Thanks.
patch( get(h,'XData'), get(h,'YData'), 'g')
Easy ;-)