为极坐标图 MATLAB 的中心设置负值
Setting a negative value for the center of a polar plot MATLAB
我想使用 MATLAB 绘制最大值设置为 0 的天线辐射方向图。其余值为负,0 应位于极坐标图中的最外圈。如果我使用常规的 polar() 函数,负值将放在它应该在的位置的另一侧。因此,极坐标图看起来像是翻转了。我不想要那个。我想要最大值,即 0 位于最外圈,而其余的负值则朝向中心,而不是在另一侧。您可以在下面看到一个示例图。我怎样才能完成绘制这样的极坐标图?非常感谢您的帮助。
rlim 似乎可以解决问题:
theta=linspace(0,2*pi,200);
%% The pattern has negative values
pattern = 10*log10(abs(1+exp(1j*17*sin(theta))));
%% Makes the max of the pattern 0
pattern=pattern-max(pattern);
%% Plots the figure
figure
pax = polaraxes;
polarplot(theta,pattern)
%% This is what you want. Add a little bit of extra space after the minimum and maximum value
rlim([min(pattern)-3 max(pattern)+1])
我想使用 MATLAB 绘制最大值设置为 0 的天线辐射方向图。其余值为负,0 应位于极坐标图中的最外圈。如果我使用常规的 polar() 函数,负值将放在它应该在的位置的另一侧。因此,极坐标图看起来像是翻转了。我不想要那个。我想要最大值,即 0 位于最外圈,而其余的负值则朝向中心,而不是在另一侧。您可以在下面看到一个示例图。我怎样才能完成绘制这样的极坐标图?非常感谢您的帮助。
rlim 似乎可以解决问题:
theta=linspace(0,2*pi,200);
%% The pattern has negative values
pattern = 10*log10(abs(1+exp(1j*17*sin(theta))));
%% Makes the max of the pattern 0
pattern=pattern-max(pattern);
%% Plots the figure
figure
pax = polaraxes;
polarplot(theta,pattern)
%% This is what you want. Add a little bit of extra space after the minimum and maximum value
rlim([min(pattern)-3 max(pattern)+1])