linux导入python matplotlib.pyplot报错

在linux端执行python脚本,有时候需要画图,但是linux没有GUI界面,因此需要在导入matplotlib.pyplot库之前先执行

import matplotlib as mpl

mpl.use('Agg')

再执行

import matplotlib.pyplot as plt

猜你喜欢

转载自blog.csdn.net/wyk9916/article/details/83618021