Matplotlib 中不带网格的极坐标图

13
有没有办法在Matplotlib的极坐标图中关闭网格线? 我尝试过matplotlib.pyplot.rgrids([], []),但它不起作用。
1个回答

23

从您的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()

13
如果你想要移除标签,只需调用 ax.set_xticklabels([])ax.set_yticklabels([]) 即可。 - Stephen Terry
如果你想要移除轮廓边框,可以使用 ax.axis("off") - Vito Gentile

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接