
Google Colabで日本語フォントを使う!
デジタルファーストキャンプの第2ターム1回目の課題で、Google Colabでグラフ作成を行ってみたところ、タイトルが文字化けします。

英語だと問題なし。

いろいろ試したところ、以下のコードで文字化けしないようになりました。
japanize-metplotlibというライブラリーをインストールして読み込むコードのようです。
!apt-get -y install fonts-ipafont-gothic
!pip install japanize-matplotlib
import japanize_matplotlib
import matplotlib.pyplot as plt
# 場合によっては必要
plt.rcParams['font.family'] = 'IPAPGothic'
japanize_matplotlib.japanize()
これで行けました。

そしてデジタル修行は続く。。。。