-
[Pandas] matplotlib 한글 폰트 설치하기프로그래밍/Python 2023. 1. 26. 16:22728x90
https://syudal.tistory.com/entry/Jupyter-pandas-matplotlib-한글-폰트-설치하기
이전에 위와 같이 포스팅 했던 것을 보면 pandas에 matplotlib 한글 폰트 설치하는 방법은 다음과 같다.
sudo apt-get install fonts-nanum*
하지만 Jupyter와는 달리 Python Console에 아래와 같이 입력해도 폰트 캐시가 삭제되지 않고 해당 메소드가 없다고 출력된다.
import matplotlib matplotlib.font_manager._rebuild()
폰트 캐시를 수동으로 삭제하면 되는데 ~/.cache/ 경로에 존재한다.
sudo rm -rf ~/.cache/
이후 Django나 Flask, Streamlit을 재실행하여 생성된 plot을 확인하면 폰트의 깨짐이 해결된 것을 볼 수 있다.
728x90댓글