본문 바로가기
Data Analytics with python/[Python Skill]

[Python] matplotlib 한글 글꼴 깨짐 현상

by 보끔밥0130 2023. 2. 3.
728x90

 

 

 

 

 

 

나눔 고딕 글꼴 적용할 경우

!apt-get update -qq
!apt-get install fonts-nanum* -qq

 

import matplotlib.font_manager as fm

path = '/usr/share/fonts/truetype/nanum/NanumGothicEco.ttf'
font_name = fm.FontProperties(fname=path, size=10).get_name()

plt.rc('font', family=font_name)
fm._rebuild()

 

import matplotlib.pyplot as plt
plt.rc('font', family='NanumBarunGothic')

 

728x90

댓글