问题描述
使用plt.imshow()时报错:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
解决方法:
step1 代码中添加matplotlib.use(‘TkAgg’)
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
step2 安装python3-tk
sudo apt-get install python3-tk