Matlab 如何删除极坐标图上的θ网格和半径网格?
我试图画出阿基米德的螺旋线:Matlab 如何删除极坐标图上的θ网格和半径网格?,matlab,plot,matlab-figure,Matlab,Plot,Matlab Figure,我试图画出阿基米德的螺旋线: t = linspace(0,5*pi,1000); a =1; r = a.*t; polar(t,r); grid off; Ax = gca; Ax.ThetaGrid = 'off'; Ax.RGrid = 'off'; Ax.RTickLabel = []; Ax.ThetaTickLabel = []; 但是,显示了以下错误: Unrecognized property 'ThetaGrid' for class 'matlab.graphics.
t = linspace(0,5*pi,1000);
a =1;
r = a.*t;
polar(t,r);
grid off;
Ax = gca;
Ax.ThetaGrid = 'off';
Ax.RGrid = 'off';
Ax.RTickLabel = [];
Ax.ThetaTickLabel = [];
但是,显示了以下错误:
Unrecognized property 'ThetaGrid' for class 'matlab.graphics.axis.Axes'.
如何删除此图像上的网格和标签
t = linspace(0,5*pi,1000);
a =1;
r = a.*t;
line_handle = polarplot(t,r); % Get line handle
Ax = line_handle.Parent; % Get its parent, i.e. polar axes
grid off;
Ax.ThetaGrid = 'off';
Ax.RGrid = 'off';
Ax.RTickLabel = [];
Ax.ThetaTickLabel = [];
产生
问题是,首先执行网格关闭会以某种方式更改当前轴的位置,将它们设置回笛卡尔坐标。由于笛卡尔坐标轴对象没有定义极坐标,因此会出现错误。
取而代之的是,抓住线上的一个手柄,然后抓住它的父对象,即极轴对象。具有您要更改的所有属性的
另外,MATLAB警告我使用而不是,所以我这么做了