使用use命令即可钝吮,必須放在調(diào)用pyplot前面埋涧! 不要使用show()函數(shù),使用save()函數(shù) import matplotlib matplotlib.use('Agg')