LoginSignup
1
4

More than 1 year has passed since last update.

【Python】matplotlibを日本語対応にする方法

Last updated at Posted at 2023-02-06

ライブラリのインストール

pip install japanize_matplotlib

※Anacondaを利用している場合
conda install -c uehara1414 japanize-matplotlib

※Jupyter Notebook、Google Colabなどの場合
!pip install japanize_matplotlib

実行

Google Colabで実行

import japanize_matplotlib
import matplotlib.pyplot as plt
import numpy as np

plt.plot([1, 2, 3,  4, 5])
plt.xlabel('x軸')
plt.ylabel('y軸')
plt.title("簡単なグラフ")
plt.show()

実行結果

日本語が文字化けせずに表示される
スクリーンショット 2023-02-06 21.53.17.png

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4