0
0

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.

junoのmatplotlibで日本語表示

Last updated at Posted at 2021-05-26

iosでpythonが動くjunoですが、標準フォントが見つからず、日本語表示できなかったので、直接指定する方法です。

カレントディレクトリに、適当にダウンロードしたttfフォントを置いた場合です。

from matplotlib import pyplot as plt
from matplotlib import font_manager as fm, rc
font_files = fm.findSystemFonts(fontpaths='./')
font_list = fm.createFontList(font_files)
fm.fontManager.ttflist.extend(font_list) 
rc('font', family=font_list[0].name)
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?