18
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

matplotlibの日本語化

Last updated at Posted at 2021-05-04

結論

親切な方がコメントで教えて下さいましたので訂正します。

matplotlib3.1以前

以下のやり方で日本語化できました。

%pip install japanize-matplotlib
import matplotlib.pyplot as plt
import japanize_matplotlib

japanize_matplotlib.japanize() 

matplotlib3.2以降(追記)

上記の日本語化ライブラリで使われている font_manager.createFontList というメソッドがmatpotlibの3.2.0より非推奨になっていると教えて下さいました。
代替手段まで示してくださっています。

どうして...?

Matplotlib 日本語化 でググって出てくる記事を上から3つくらい読んでもjapanize-matplotlibの話が出てきません。こんなに簡単なのにどうして…?

pipでパッケージをインストールしなければならない点と、フォントを選べない点を欠点として挙げている記事もありました。見た目にこだわったサービスを組織で開発しているケースなら別ですが、個人でデータ分析していててっとり早く可視化したいだけの私にはjapanize-matplotlibで十分でした。

(2021/5/7追記)非推奨と知っても個人で使ってるだけの私はGoogleColaboratory環境(今日時点でmatplotlib3.2.2)で動くうちは使ってしまうと思います。そうじゃない方はご注意ください。

18
17
4

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
18
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?