How can I remove the grid lines and labels from a polar plot within MATLAB?
13 views (last 30 days)
Show older comments
I have created a plot with the POLAR function from which I want to remove the grid lines and labels. However, changing the axes' properties does not affect the polar plot.
Accepted Answer
MathWorks Support Team
on 31 Aug 2010
There are no actual polar axes in MATLAB 6.5.1 (R13SP1) and earlier versions. The polar plot is created with a patch object representing the background, and multiple line and text objects used to create the grid lines and labels, respectively. These objects exist in an axes, whose "Visible" property has been set to "off".
You can remove the labels and grid lines from a polar plot by locating their handles with the FINDALL function, and using the DELETE function to remove them.
% create the polar plot, and store the line's handle
p = polar((0:99)*pi/100, (0:99)/100);
% find all of the lines in the polar plot
h = findall(gcf,'type','line');
% remove the handle for the polar plot line from the array
h(h == p) = [];
% delete all other lines
delete(h);
% find all of the text objects in the polar plot
t = findall(gcf,'type','text');
% delete the text objects
delete(t);
0 Comments
More Answers (0)
See Also
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!