2017-07-30 13 views
3

matplotlibを使用したときに次のエラーが発生しました。私はこの警告メッセージを修正することを知りたいです。私はplt.contourf()axis = 0を渡そうとしましたが、助けになりません。matplotlibの使用中に "MaskedArrayFutureWarning"を修正するには?

警告:

C:\Users\user\Anaconda3\lib\site-packages\numpy\ma\core.py:6385: MaskedArrayFutureWarning: In the future the default for ma.minimum.reduce will be axis=0, not the current None, to match np.minimum.reduce. Explicitly pass 0 or None to silence this warning. 
    return self.reduce(a) 

コード:

figT = plt.figure(figsize=(20,15)) # (width, height) 
for i in range(n_cases): 
    ax = plt.subplot(3, 3, i+1) 
    plt.contourf(x, y, sess.run(T[:,:,i]), colorInterpolation, cmap=colorMap) 
    plt.colorbar().ax.set_ylabel('Temperature ($^\circ$C)', fontsize = set_fontSize) 
    plt.xlabel('X Position', fontsize = set_fontSize) 
    plt.ylabel('Y Position', fontsize = set_fontSize) 
    plt.title("Case %d" % (i+1), fontsize = set_fontSize) 
figT.savefig(dirFig+'T_results.png', format='png', dpi=set_dpi, bbox_inches='tight') 
+0

修正方法を教えてください。私は 'plt.contourf(axis = 0)'を試みましたが、警告はまだそこにあります。 – world2005

+0

警告を投げるコードは間接的に呼び出され、libにあるようです。すべてのライブラリが最新のものであることを確認してください。 –

答えて

1

matplotlibの1.5.3を使用しているとき、私はこのエラーを得ました。以下のコマンドを発行した後:

conda update matplotlib 

Matplotlibが2.0.2にアップデートされ、警告が消えました。

関連する問題