热线电话:13121318867

登录
2020-09-01 阅读量: 890
解决matplotlib中文乱码问题?

永久解决方法

  1. 首先将windwos中fonts目录下的simhei.ttf拷贝到/usr/share/matplotlib/mpl-data/fonts/ttf目录中

  2. 修改配置文件
    去除这三列之前的‘#’
    在font.sans-serif后添加,SimHei

    ```
    #font.family         : sans-serif        
    #font.sans-serif     : SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif   
    ...
    #axes.unicode_minus : False #解决负号'-'显示为方块的问题
    ```
    • 1

    • 2

    • 3

    • 4

    • 5

    • 6

  3. 删除~/.cache/matplotlib的缓冲


34.9469
0
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子
0条评论