python中plt.show()無法顯示圖片問題

問題描述:

出現以下情況

UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
  % get_backend())

解決辦法,導入下邊這個matplotlib.use('TkAgg')語句就可以了

import matplotlib; matplotlib.use('TkAgg')

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章