matplotlib 中文显示
下面为博客摘要,详细内容请看http://keke046.github.io/2022/04/06/matplotlib-chinese/
com/Yehrin/FontLibrary/master/simhei。matplotlib_fname())'`"MPL_FONTS=`dirname "${MPL_RC}"`/fontsMPL_CACHE="`python -c 'import matplotlib; print(matplotlib。!-- indicate-the-source --# matplotlib 中文显示matplotlib每次更新似乎中文字体都会炸。fontset: dejavusans/mathtext。bak | \sed -e 's/#font。family:/g' | \sed -e 's/font。ttf"[ -f ${MPL_FONTS}/ttf/simhei。family:/font。unicode_minus: False/g' |\sed -e 's/#mathtext。fontset: cm/g' ${MPL_RC}rm -rf "${MPL_CACHE}"```!--more--。get_cachedir())'`"TTF_URL="https://raw。ttf ] || wget "${TTF_URL}" -P "${MPL_FONTS}/ttf" -q --show-progresscp ${MPL_RC} ${MPL_RC}。写了一个bash脚本来自动修复matplotlib字体,只适用于linux。githubusercontent。family:/font。family:/g' | \sed -e 's/font。```bashMPL_RC="`python -c 'import matplotlib; print(matplotlib。family: SimHei,/g' | \sed -e 's/#axes。unicode_minus:/g'| \sed -e 's/axes。unicode_minus: True/axes。family: *SimHei,/font。unicode_minus:/axes。bakcat ${MPL_RC}
matplotlib 中文显示
matplotlib每次更新似乎中文字体都会炸。写了一个bash脚本来自动修复matplotlib字体,只适用于linux。
1 | MPL_RC="`python -c 'import matplotlib; print(matplotlib.matplotlib_fname())'`" |
com/Yehrin/FontLibrary/master/simhei。matplotlib_fname())'`"MPL_FONTS=`dirname "${MPL_RC}"`/fontsMPL_CACHE="`python -c 'import matplotlib; print(matplotlib。!-- indicate-the-source --# matplotlib 中文显示matplotlib每次更新似乎中文字体都会炸。fontset: dejavusans/mathtext。bak | \sed -e 's/#font。family:/g' | \sed -e 's/font。ttf"[ -f ${MPL_FONTS}/ttf/simhei。family:/font。unicode_minus: False/g' |\sed -e 's/#mathtext。fontset: cm/g' ${MPL_RC}rm -rf "${MPL_CACHE}"```!--more--。get_cachedir())'`"TTF_URL="https://raw。ttf ] || wget "${TTF_URL}" -P "${MPL_FONTS}/ttf" -q --show-progresscp ${MPL_RC} ${MPL_RC}。写了一个bash脚本来自动修复matplotlib字体,只适用于linux。githubusercontent。family:/font。family:/g' | \sed -e 's/font。```bashMPL_RC="`python -c 'import matplotlib; print(matplotlib。family: SimHei,/g' | \sed -e 's/#axes。unicode_minus:/g'| \sed -e 's/axes。unicode_minus: True/axes。family: *SimHei,/font。unicode_minus:/axes。bakcat ${MPL_RC}