tata色々な備忘録

データ解析、画像解析、化学分析などなど

matplotlib、pylabで日本語+フォント変更

ここを見ながら実施

http://www.sakito.com/2012/01/matplotlib.html

matplotlib.matplotlib_fname()

でmatplotlibrcの場所を調べる。

$copy C:/python/site-packages/matplotlib/mpl-data/matplotlibrc ~/.matplotlib

~/.matplotlib/matplotlibrcに下記を記載する。

font.serif : MSGothic
font.sans-serif : MSGothic

import pylab as plt
plt.rcParams['font.family'] = 'MSGothic'

と入れること。