从matplotlib 2.02升级_> 2.1.0打破极坐标图?

时间:2017-12-06 13:20:22

标签: python matplotlib grid

昨天我从matplotlib V2.0.2升级到2.1.0&我的阴谋似乎已经破裂了。我已将代码缩减到显示我遇到的问题所需的最低限度:

  1. 使用ax.set_thetagrids的Theta标签放置现在对我不起作用。
  2. ax.grid不像以前那样工作。
  3. 我不得不说我是matplotlib的新手,但是这些东西主要是让我对v2.0.2感到满意。

    有什么想法吗?下面是我的精简代码以及v2.02安装和v2.1.0安装的输出图的图像。两个图像都是使用相同的代码生成的。谢谢你的帮助。

        # -*- coding: utf-8 -*-
    
    import matplotlib.pyplot as plt
    import numpy as np
    
    fig = plt.figure()
    rect = 0,0,1,1
    
    ax = fig.add_axes(rect, label = 'ax', polar=True)
    ax.patch.set_alpha(0) #Because I'll be using this grid as an overlay on an image axis
    ax.set_theta_zero_location( "N" )
    ax.set_theta_direction( 1 )
    thetaticks = np.arange( 0, 360, 45 )
    
    ax.set_thetagrids( thetaticks, weight = 'bold', frac = 0.93 ) #No effect on label placement (puts them inside in v2.0.2)
    ax.grid( False, 'both', color = 'k', linestyle = 'dotted', linewidth = 1.5 ) #Only applies to theta lines in v2.1.0, worked on both in 2.0.2
    
    plt.show()
    

    2.0.2的输出:
    Output from 2.0.2

    2.1.0的输出 Output from 2.1.0

0 个答案:

没有答案