我在 Matlab 上绘制了一个填充有颜色的极坐标直方图。但是,对于某些数据,它变得很奇怪。你知道为什么会这样吗?如果是,如何解决?谢谢!
这是我的代码:
theta = my_data; % vector of angles in radian
figure('color','w')
[tout, rout] = rose(theta,36);
polar(tout, rout);
[xout, yout] = pol2cart(tout, rout);
set(gca, 'nextplot', 'add');
fill(xout, yout, 'b','FaceAlpha',0.6)
% ------ we add the mean vector
m = mean(theta)
hold on
plot([0 cos(m)*50], [0 sin(m)*50], 'Linewidth',3,'Color','r')