MATLAB: How to remove the border of a polarplot

axes handlesgcagcfplottingpolarpolarplot

Hi, I have an exercise in which i need to evaluate some graphic handles of MATLAB (I use R2014b)
I have created the following plot.
How do I remove the thin circular boundary from this plot?
That is the thin grey boundary, So it is not about the rectangular box.
I've used the following code to create my graph
clc; close all
figure(1);
theta = linspace(0,2*pi,201);
r = sqrt(abs(2*sin(5*theta)));
h = polar(theta,r);
patch( get(h,'XData'), get(h,'YData'), 'k')
delete(findall(gcf,'type','line','-or','type','text'));
box on
ax = gca;
ax.Title.String = 'Flower Power';
ax.Title.FontWeight = 'normal';
ax.Visible = 'on';
ax.XGrid = 'off';
ax.XTick = [];
ax.YTick = [];
ax.XTickLabel = [];
ax.YTickLabel = [];
ax.LineWidth = 2;

Best Answer

You cannot change much with the polar function. (The polarplot function was introduced in R2016a to make the plot more usable.)
Try this instead:
theta = linspace(0,2*pi,500);
r = sqrt(abs(2*sin(5*theta)));
[x,y] = pol2cart(theta, r);
figure(1)
plot(x, y)
hold on
patch([x fliplr(x)], [zeros(size(y)) fliplr(y)], 'k', 'EdgeColor','none')
hold off
axis equal
set(gca, 'XTick',[], 'YTick',[], 'XColor','none', 'YColor','none')
title('\itFlower Power!\rm', 'FontSize',20)
To produce:
The blue haze near the centre is probably due to aliasing. If you have the same problem, you may have to experiment with different renderers to get rid of it.