Notice
Recent Posts
Recent Comments
Link
목록Programming/Python (9)
소연이의 메모장
[Python] 시각화를 위한 한글 폰트 설정
matplotlib에서 한글폰트를 사용하여 시각화를 할 때 네모네모로 글자가 깨지는 현상이 발생한다. 이걸 해결하기 위한 python 코드다. 우선 네이버의 나눔글꼴을 다운 받아야 한다. 시스템 환경이 윈도우라면 맑은고딕이 실행된다. 그리고 마이너스 폰트까지 잘 나오는지 확인하는 코드도 있다. def get_font_family(): """ 시스템 환경에 따른 기본 폰트명을 반환하는 함수 """ import platform system_name = platform.system() # colab 사용자는 system_name이 'Linux'로 확인 if system_name == "Darwin" : font_family = "AppleGothic" elif system_name == "Windows": f..
Programming/Python
2022. 8. 16. 01:25