UserWarning: Matplotlib is currently using agg 出現錯誤
執行PYTHON時,出現錯誤UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure
或是出現這錯誤訊息
AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?
解決方法
import matplotlib #加入這兩行
matplotlib.use('TkAgg') #加入這兩行
import matplotlib.pyplot as plt
頁:
[1]