Python Polar Plot问题

时间:2016-09-10 15:57:56

标签: python matplotlib

我的数据在23小时左右结束,但它会像下图所示继续循环: enter image description here

代码:

ax = plt.subplot(111, projection='polar')
ax.plot(x,y)

ax.set_theta_direction(-1)
ax.set_theta_offset(pi/2.0)
ax.set_xticks(np.linspace(0, 2*pi, 24, endpoint=False))
ax.set_xticklabels(range(24))
ax.set_yticks((0.300,0.350,0.400,0.450,0.500,0.550,0.600))
ax.set_ylim([0.3,0.6])
ax.set_yticklabels(('300','350','400','450','500','550','600'))

plt.show()

由于

1 个答案:

答案 0 :(得分:0)

您必须将ax.plot中定义的x轴转换为0到2 * PI。 例如x [:] = x [:] /(2. * pi)在ax.plot之前