在使用PyCharm时,用到pandas中的scatter_matrix,但是无法呈现出散点图矩阵图形,并且在控制台报出:UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.的警告。
通过查阅相关博文,发现了解决方案。可以将Matplotlib的backend从agg转变为tkagg,具体做法是在`import matplotlib.pyplot as plt`之前加入`import matplotlib; matplotlib.use('TkAgg')`。
主要参考的博文是:https://blog.youkuaiyun.com/qq_41073715/article/details/105033751。
PyCharm中Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure问题
于 2023-08-12 22:31:12 首次发布