【问题标题】:Polar plot without grid in matplotlibmatplotlib中没有网格的极坐标图
【发布时间】:2011-06-17 12:02:02
【问题描述】:

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

【问题讨论】:

    标签: python matplotlib


    【解决方案1】:

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

    【讨论】:

    • 如果你想删除标签,你只需要打电话给ax.set_xticklabels([])和ax.set_yticklabels([])。
    • 如果你想去掉轮廓边框,使用ax.axis("off")
    猜你喜欢
    • 2017-05-18
    • 1970-01-01
    • 2015-09-12
    • 2020-06-19
    • 2016-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多