解決Mac matplotlib.plot 中文字體顯示問題,親測好用!

Mac matplotlib.plot 中文字體顯示問題

參考自知乎 https://www.zhihu.com/question/25404709
親測找到方法中最有效而且便捷。

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

選取存在的中文字體在這裏插入圖片描述

plt.rcParams['font.family']=['Heiti TC']

在這裏插入圖片描述
就闊以完美解決中文顯示的問題啦!開心,折騰了好久。繼續幹活

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章