1. 程式人生 > >解決python matplotlib中文亂碼問題

解決python matplotlib中文亂碼問題

修改配置檔案matplotlibrc

Python36\site-packages\matplotlib\mpl-data\matplotlibrc 如下最後l兩行:

  1. #font.size           : 10.0
    #font.serif          : 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     : DejaVu Sans, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
    #font.cursive        : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
    #font.fantasy        : Comic Sans MS, Chicago, Charcoal, Impact, Western, Humor Sans, xkcd, fantasy
    #font.monospace      : DejaVu Sans Mono, Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
    #font.sans-serif      : SimHei
    font.sans-serif      : KaiTi
    axes.unicode_minus   : False