找回密碼
 註冊
搜索
查看: 895|回復: 0

[教學] UserWarning: Matplotlib is currently using agg 出現錯誤

[複製鏈接]
發表於 2023-7-13 22:55:18 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
執行PYTHON時,出現錯誤
  1. UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure
複製代碼


或是出現這錯誤訊息
  1. AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?
複製代碼


解決方法


  1. import matplotlib #加入這兩行
  2. matplotlib.use('TkAgg') #加入這兩行
  3. import matplotlib.pyplot as plt
複製代碼

Matplotlib agg python

 Matplotlib  agg python

 
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-6-16 04:28 , Processed in 0.025295 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表