美文网首页
kaggle上的matplotlib 乱码

kaggle上的matplotlib 乱码

作者: smallcui | 来源:发表于2019-03-20 12:21 被阅读0次

    查看支持的字体

    import matplotlib
    a=sorted([f.name for f in matplotlib.font_manager.fontManager.ttflist])
    print(a)
    

    结果

    ['DejaVu Math TeX Gyre', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans', 'DejaVu Sans Display', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Sans Mono', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif', 'DejaVu Serif Display', 'Droid Sans Fallback', 'Liberation Mono', 'Liberation Mono', 'Liberation Mono', 'Liberation Mono', 'Liberation Sans', 'Liberation Sans', 'Liberation Sans', 'Liberation Sans', 'Liberation Sans Narrow', 'Liberation Sans Narrow', 'Liberation Sans Narrow', 'Liberation Sans Narrow', 'Liberation Serif', 'Liberation Serif', 'Liberation Serif', 'Liberation Serif', 'Noto Mono', 'STIXGeneral', 'STIXGeneral', 'STIXGeneral', 'STIXGeneral', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXNonUnicode', 'STIXSizeFiveSym', 'STIXSizeFourSym', 'STIXSizeFourSym', 'STIXSizeOneSym', 'STIXSizeOneSym', 'STIXSizeThreeSym', 'STIXSizeThreeSym', 'STIXSizeTwoSym', 'STIXSizeTwoSym', 'cmb10', 'cmex10', 'cmmi10', 'cmr10', 'cmss10', 'cmsy10', 'cmtt10']
    

    然后就设置一行,就可以了

    import matplotlib.pyplot as plt
    plt.rcParams['font.family'] = ['Droid Sans Fallback']
    

    相关文章

      网友评论

          本文标题:kaggle上的matplotlib 乱码

          本文链接:https://www.haomeiwen.com/subject/oudzmqtx.html