2017/02/24

matplotlib 日本語タイトルなど

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
fp = FontProperties(fname=r'C:\WINDOWS\Fonts\YuGothic.ttf', size=14)
X = np.linspace(0, 2*np.pi, 100);
C = np.cos(X);
plt.plot(X, C);
plt.title(u"余弦関数", fontproperties=fp)
plt.xlabel(u"位相", fontproperties=fp)

0 件のコメント: