在matplotlib中没有网格的极坐标图

mdm*_*mdm 10 python matplotlib

有没有办法在matplotlib中转换极坐标图的网格?我试过matplotlib.pyplot.rgrids([], []),但它不起作用.

Ste*_*rry 19

从你的axes实例,打电话grid(False).

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, polar=True)
ax.grid(False)

r = np.arange(0,1,0.001)
theta = 2*2*np.pi*r

ax.plot(theta,r)
plt.show()
Run Code Online (Sandbox Code Playgroud)

  • 如果你想删除标签,你只需要调用`ax.set_xticklabels([])`和`ax.set_yticklabels([])`. (9认同)