1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| import subprocess FontNotInstalled = subprocess.run('fc-list | grep "Noto Serif CJK JP"', shell=True)
if FontNotInstalled.returncode: subprocess.run('apt install -y fonts-noto-cjk', shell=True) import matplotlib cache_dir = matplotlib.get_cachedir() import shutil shutil.rmtree(cache_dir) import os os._exit(0) else: pass
from matplotlib import rcParams rcParams['font.family'] = 'Noto Serif CJK JP' rcParams['axes.unicode_minus'] = False
|