Koreanize Matplotlib

raw JSON →
0.1.1 verified Sat May 09 auth: no python

Automatically sets Korean font configurations for matplotlib, handling missing glyphs and avoiding font warnings. Current version 0.1.1, released as a lightweight wrapper; low cadence.

pip install koreanize-matplotlib
error RuntimeError: Cannot find any Korean font installed on the system.
cause No Korean font (e.g., NanumGothic, Noto Sans CJK) is installed.
fix
Install a Korean font: 'sudo apt-get install fonts-nanum' or download Noto Sans CJK.
error AttributeError: module 'koreanize_matplotlib' has no attribute 'enable'
cause Using koreanize_matplotlib.enable() on version 0.1.1 where it was removed.
fix
Use 'import koreanize_matplotlib' only (no explicit enable call).
error UserWarning: findfont: Font family ['NanumGothic'] not found.
cause Matplotlib cache does not include the Korean font after installation.
fix
Delete matplotlib cache: rm -rf ~/.cache/matplotlib; or force rebuild with 'matplotlib.font_manager._load_fontmanager(try_read_cache=False)'.
gotcha Import order: koreanize_matplotlib must be imported before any matplotlib font operations. If imported after plt has been used, font may not be applied correctly.
fix Move import to top of script, before any matplotlib usage.
gotcha The library only sets a default Korean font; custom font configurations or rcParams overrides will take precedence and may break Korean rendering.
fix If you manually set 'font.family' later, ensure it includes a Korean font.
deprecated The function 'koreanize_matplotlib.enable()' is deprecated in favor of simple import side effect.
fix Replace 'koreanize_matplotlib.enable()' with just 'import koreanize_matplotlib'.

Simply import koreanize_matplotlib before plotting to enable Korean font support.

import matplotlib.pyplot as plt
import koreanize_matplotlib

plt.plot([1,2,3], [4,5,6])
plt.title('한글 제목')
plt.show()