matplotlib中国語フォントを使用
1146 ワード
matplotlib自体は中国語をサポートしていません(utf-8はダメですか)が、一定の方法で解決できます
ただし
from matplotlib import font_manager
# fname
my_font = font_manager.FontProperties(fname=r"C:\Windows\Fonts\msyhl.ttc")
# fontproperties
plt.title(" ", fontproperties=my_font)
ただし
plt.legend
ではprop
が必要ですplt.legend(prop=my_font)