Python matplotlib集合\u rmax和集合\u rticks不工作

Python matplotlib集合\u rmax和集合\u rticks不工作,python,matplotlib,ipython,polar-coordinates,Python,Matplotlib,Ipython,Polar Coordinates,我在anaconda jupyter笔记本中使用python3,并在极坐标中绘制图形。我希望所有的图都有相同的rmax和RTICK,但是当我设置它们时,它们没有被应用,点也没有正确绘制。这是我的代码,没有,然后有 %pylab inline X = asarray([[0.23, 0.73],[0.22, 1.16],[0.18, 1.86],[0.17, 2.39],[0.24, 2.74],[0.16, 3.43],[0.16, 3.87],[0.13, 4.39],[0.14, 5.00]

我在anaconda jupyter笔记本中使用python3,并在极坐标中绘制图形。我希望所有的图都有相同的rmax和RTICK,但是当我设置它们时,它们没有被应用,点也没有正确绘制。这是我的代码,没有,然后有

%pylab inline
X = asarray([[0.23, 0.73],[0.22, 1.16],[0.18, 1.86],[0.17, 2.39],[0.24, 2.74],[0.16, 3.43],[0.16, 3.87],[0.13, 4.39],[0.14, 5.00],[0.17, 5.53]])

ax0 = subplot(111, projection='polar')
ax0.plot(X[:,1], X[:,0], 'r+')
show()

ax1 = subplot(111, projection='polar')
ax1.set_rmax(0.8)
ax1.set_rticks([0.2, 0.4, 0.6, 0.8])
ax1.plot(X[:,1], X[:,0], 'r+')
show()
下面是情节


问题在于,您首先要设置
rmax
,然后绘制极坐标图。因此,一旦绘制,将自动调整限制,并覆盖设置的
rmax
rticks

解决方案是首先绘制,然后设置
rmax
rticks
,如下所示

ax1 = plt.subplot(111, projection='polar')
ax1.plot(X[:,1], X[:,0], 'r+')
ax1.set_rmax(0.8)
ax1.set_rticks([0.2, 0.4, 0.6, 0.8])