빅데이터 김교수의 "AI노마드연구소" AI로 열어가는 노마드 세상!

빅데이터 김교수의 "AI노마드연구소" AI로 열어가는 노마드 세상입니다. AI 코딩작성, SNS 분석, AI업무자동화 컨설팅 0507-1419-0222

자세히보기

카테고리 없음

colab matplotlib함수 수행시 한글 깨짐 문제 해결하기

빅데이터 김교수 2022. 5. 19. 15:42

##  한글 깨짐 문제 해결



# Google Colab matplotlib 한글 폰트 오류 문제 해결
# colab과 google Drive 연동을 위한 인증 및 네트워크 디렉토리 마운트
from google.colab import auth
auth.authenticate_user()

from google.colab import drive
drive.mount('/content/drive')

# 1. 나눔 폰트 다운
!sudo apt-get install -y fonts-nanum
!sudo fc-cache -fv
!rm ~/.cache/matplotlib -rf

# 2. 런타임 다시 시작



# 3. matplotlib의 폰트를 Nanum 폰트로 지정
import matplotlib.pyplot as plt
plt.rc('font', family='NanumBarunGothic')