Can't Get ThetaZeroLocation to Work Properly Using polarplot
19 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have binaural audio measurements made with a head and torso simulator on a turntable. Impulse response were measured for 81 angles at 3° increments (so, 240° to 120° via 0°) to cover the maximum rotation of a human head (and beyond). So, the angle values are a vector ...
Angles = [240:3:357, 0:3:120]; % Vector of angle/azimuth positions
But when I try to plot with the zero location at 'top' (i.e., "north", "12 o'clock", etc.), it stays at the default of 'right. No other directions work either. My feeling is that the ordering of my angles vector is interfering, but I have no idea why - it plots how I'd like, just on its side.
The example here works fine:
... but not with my angle vector as the theta value, which is what leads me to think that's the issue. The full plotting code I'm using (with random numbers for simulated data) is ...
Angles = [240:3:357, 0:3:120]; % Vector of angle/azimuth positions
theta = deg2rad(Angles);
rho = rand(1,81);
ax = polaraxes;
ax.ThetaZeroLocation = 'top';
polarplot(theta,rho);
Many thanks in advance for any advice or suggestions people have. Cheers!
0 个评论
采纳的回答
Adam Danz
2021-12-4
编辑:Adam Danz
2021-12-4
You have to either hold the axes after setting ThetaZeroLocation or set ThetaZeroLocation after plotting. Otherwise, when you plot using polarplot it resets the properties.
Angles = [240:3:357, 0:3:120];
Angles = [240:3:357, 0:3:120]; % Vector of angle/azimuth positions
theta = deg2rad(Angles);
rho = rand(1,81);
ax = polaraxes;
ax.ThetaZeroLocation = 'top';
hold(ax, 'on') % <----------- hold
polarplot(theta,rho);
4 个评论
Steven Lord
2021-12-5
This behavior is not limited to polarplot. High-level plotting functions basically call newplot before they create their lines, surfaces, etc. newplot checks certain figure and axes properties to determine how to prepare the figure and axes for those new lines, surfaces, etc. hold changes those figure and axes properties. See the documentation page for more details.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!