我有一份角度表。我想显示一个极柱状图,在这个柱状图中,[0°,360°)的值被细分为相等的单元,并显示角度列表中每个单元中有多少个值。我使用以下代码获取柱状图数据(我检查了它是否正确):
bins_number = 8 # the [0, 360) interval will be subdivided into this number of equal bins
bins = np.linspace(0.0, 360.0, bins_number + 1)
n, _, _ = plt.hist(angles, bins)
现在,我尝试使用以下代码将这些数据绘制成极性柱状图:
^{pr2}$如您所见,条形图没有以正确的角度放置,并且其中一些条彼此重叠,而它们应该是连续的而不重叠。在
我做错什么了?提前谢谢你。在
这里只绘制了箱子的中心与每个箱子中出现的角度的数量
在注释中,使用弧度而不是度数:
相关问题 更多 >
编程相关推荐