ちょっと調べたら「matplotlibrcの書き換え」とか、沢山方法はあるみたいですが、なんだか面倒だったので一番簡単かと思われる方法をメモしておきます。
ttfファイルのダウンロード
IPAexフォント/IPAフォント
準備として、例えば上のようなサイトとかからTTFフォントのファイルをダウンロードします。
設定
試しに、簡単な折れ線グラフにラベルをつけてみます。
.py
%matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
font_path= "ttfファイルのPATH"
font_prop =matplotlib.font_manager.FontProperties(fname=font_path,size=20)
x = [1,2, 3, 4, 5]
y = [5, 1, 3, 2, 4]
plt.xlabel('xラベル',fontproperties=font_prop)
plt.ylabel('yラベル',fontproperties=font_prop)
plt.plot(x, y)
plt.show()