1. 程式人生 > 實用技巧 >python報錯:TypeError: ‘module‘ object is not callable的解決方法

python報錯:TypeError: ‘module‘ object is not callable的解決方法

在使用python的matplotlib庫作圖時,報錯顯示TypeError: ‘module’ object is not callable

這是我原來的程式碼及報錯顯示:
在這裡插入圖片描述
後面發現需要在匯入時將matplotlib修改為matplotlib.pyplot即可
這是我修改後的程式碼及結果顯示
在這裡插入圖片描述