如何在google colab matplotlib画图中使用中文 2020-12-01
如何在google colab matplotlib画图中使用中文
首先要有中文字体:
!gdown --id 1fsKERl26TNTFIY25PhReoCujxwJvfyHn
import matplotlib as mpl
zhfont = mpl.font_manager.FontProperties(fname='SimHei .ttf')
其次在使用的中文字符串前加u,并在后面附上中文字体名。
plt.title("拍摄角度:0,5,10",fontproperties=zhfont)
plt
原创
2020-12-01 13:41:11 ·
2225 阅读 ·
2 评论