How do I turn off the grid in a polar plot?
이전 댓글 표시
For a normal MATLAB plot, I can turn the grid off and on with the grid command.
x = 1:10;
plot(x,sin(x))
grid on % now the grid is on
pause(1)
grid off % now it's off
But that doesn't work for a polar plot. Plus the grid is on by default. How do I turn it off?
채택된 답변
추가 답변 (2개)
Walter Roberson
2011년 1월 20일
% 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'));
댓글 수: 1
Walter Roberson
2011년 1월 20일
Answer updated to avoid relying on gcf in case the plot is in a different figure.
Daniel Zuth
2017년 1월 3일
1 개 추천
Use polarplot() instead polar() and grid off.
댓글 수: 1
Walter Roberson
2017년 1월 3일
Yes, that is a good method for R2016a or later. polarplot() did not exist when the question was first posted in 2011.
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!