linux环境下import matplotlib报错

Debug

在linux下使用matplotlib画图,报错
_tkinter.TclError: no display name and no $DISPLAY environment variable
加入一句plt.switch_backend(‘agg’),即可

import matplotlib.pyplot as plt
plt.switch_backend('agg')
发布了22 篇原创文章 · 获赞 0 · 访问量 4443

猜你喜欢

转载自blog.csdn.net/Yolo_C/article/details/90675071