pandas绘图中文字会出现方框的乱码。
解决步骤:
* 1 找到C:\Users\Administrator\Anaconda3\Lib\site-packages\matplotlib\mpl-data\matplotlibrc.py,打开
* 2 修改
font.family : sans-serif
font.style : normal
font.variant : normal
font.weight : medium
font.stretch : normal
*3修改,加入 SimHei, 或者simsun, 要看window自带什么中文字体包,一般simsun是有的
font.serif : SimHei, DejaVu Serif, Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
font.sans-serif : SimHei, DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
4修改
axes.unicode_minus : False # use unicode for the minus symbol
5.保存就行了
网友评论