OS: Centos7
sudo yum install -y nhn-nanum-gothic-fonts
ls -al /usr/share/fonts
drwxr-xr-x 2 root root 101 Nov 19 18:07 nhn-nanum
rm -rf ~/.cache/matplotlib/*
from matplotlib import font_manager
[f.fname for f in font_manager.fontManager.ttflist]
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
# 테스트 레이블 값 설정
x_labels = [i for i in range(10)]
y_labels = [i * 2 for i in x_labels]
# 폰트 설정
fontpath = '/usr/share/fonts/nhn-nanum/NanumGothic.ttf'
NanumGothicFont = fm.FontProperties(fname=fontpath, size=10)
NanumGothicFontProp = {'family': NanumGothicFont.get_name(), 'size': 10}
plt.plot(x_labels, y_labels, marker='o', label="테스트")
plt.xlabel("x 레이블", fontdict=NanumGothicFontProp)
plt.ylabel("y 레이블", fontdict=NanumGothicFontProp)
plt.title("테스트", fontproperties=NanumGothicFont)
plt.legend(prop=NanumGothicFontProp)
plt.show()