[파이썬] Matplotlib에 한글 표현하기

파이썬에서 그래프를 그릴 때 많이 사용하는 모듈이 Matplotlib일 것이다. 이 모듈을 사용할 때, 한글을 나타내려면 다음과 같이 하면 된다. 특히 맥을 사용할 경우에 유용하다.

import matplotlib.pyplot as plt #그래프 작성용

plt.rcParams["font.family"] = 'AppleGothic' # 맥에서 한글 출력
plt.rcParams['axes.unicode_minus'] = False  # 한글폰트 마이너스 기호 문제