Category: MatlabHow to remove border?

Hey, I need to remove the border of a polar plot using MATLAB, but the problem is I am using MATLAB for the very first time so, I have no idea about how to do it. Please tell me some ways so that I can remove the same.

asked on 03 Aug 18Ritu Gupta ritu gupta
2 Answers
answered on 03 Aug 18

You cannot change much with the polar function. (The polar plot 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)

Brijesh Sharma brijesh sharma
answered on 04 Aug 18

You can also use this:
% create the polar plot, and store the line’s handle
p = polar((0:99)*pi/100, (0:99)/100);
%remove lines and text objects except the main line
delete(findall(ancestor(p,’figure’),’HandleVisibility’,’off’,’type’,’line’,’-or’,’type’,’text’));

Luv Bhatia luv bhatia

Not the answer you're looking for? Browse other questions or ask your own question.