这两个命令的角度是定死的,没有提供任何接口去修改。
你一定要改,就只能改这两个命令的源代码了
打开polar.m后可以找到下面这段语句
% plot spokes
th = (1:6)*2*pi/12;
cst = cos(th); snt = sin(th);
cs = [-cst; cst];
sn = [-snt; snt];
line(rmax*cs,rmax*sn,'linestyle',ls,'color',tc,'linewidth',1,...
'handlevisibility','off','parent',cax)
把th改成别的值就可以绘制不同的角度了,比如改成th = (1:4)*2*pi/8;就是45度的分割线了。
当然下面还要继续改显示的度数
% annotate spokes in degrees
rt = 1.1*rmax;
for i = 1:length(th)
text(rt*cst(i),rt*snt(i),int2str(i*30),...
'horizontalalignment','center',...
'handlevisibility','off','parent',cax);
if i == length(th)
loc = int2str(0);
else
loc = int2str(180+i*30);
end
text(-rt*cst(i),-rt*snt(i),loc,'horizontalalignment','center',...
'handlevisibility','off','parent',cax)
end
把两个30全部改为45即可。
——————————————————————————————
反正就是在这两段里改就是了。
% plot spokes
th = (1:6)*2*pi/12;
cst = cos(th); snt = sin(th);
cs = [-cst; cst];
sn = [-snt; snt];
line(rmax*cs,rmax*sn,'linestyle',ls,'color',tc,'linewidth',1,...
'handlevisibility','off','parent',cax)
% annotate spokes in degrees
rt = 1.1*rmax;
for i = 1:length(th)
text(rt*cst(i),rt*snt(i),[int2str(i),'N'],...
'horizontalalignment','center',...
'handlevisibility','off','parent',cax);
if i == length(th)
loc = [int2str(0),'N'];
else
%loc = int2str(180+i*30);
loc=[int2str(i+6),'N'];
end
text(-rt*cst(i),-rt*snt(i),loc,'horizontalalignment','center',...
'handlevisibility','off','parent',cax)
end
温馨提示:答案为网友推荐,仅供参考