Eat all the tofus in your matplotlib plot!
Download and install Noto fonts to matplotlib library without modifying system fonts. Supports Chinese, Japanese, Korean, and any font in Google fonts repo. This is useful when using Google Colab and Sagemaker Studio/Notebooks.
pip install git+https://github.com/cgjosephlee/mpl_no_tofu.git
import matplotlib.pyplot as plt
from mpl_no_tofu import load_fonts
load_fonts("NotoSansTC")
# your plots
- NotoSansTC
- NotoSerifTC
- NotoSansSC
- NotoSerifSC
- NotoSansHK
- NotoSansJP
- NotoSerifJP
- NotoSansKR
- NotoSerifKR
Find your font in Google fonts repo and copy the path of METADATA.pb
.
load_fonts("https://github.com/google/fonts/raw/main/ofl/notosansthailooped/METADATA.pb")