반응형
파이썬 쥬피터(juypter) 한글 깨짐 현상
파이썬에서 주로 사용하는 jupyter notebook에서 한글을 설정 안하면 깨진다. 'ㅁㅁㅁㅁ'로 표시 되기 때문에 한글을 설치하고, 세팅하는 작업이 필요하다
Centos에 한글 나눔 글씨체 설치
``` $ cd /usr/share/fonts/ $ wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFontTTFALL.zip
$ unzip NanumFontTTFALL.zip -d NanumFont $ rm -f NanumFontTTFALL.zip ```
[참고] 2017.02.20 - Centos 나눔글씨체 설치하는 방법 http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4%EB%82%98%EB%88%94%ED%8F%B0%ED%8A%B8%EC%84%A4%EC%B9%98
코드에서 한글 세팅
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from matplotlib import font_manager, rc | |
fontname = u'/usr/share/fonts/nhn-nanum/NanumGothic.ttf' #plt.font_manager.get_fontconfig_fonts()[0] | |
fontname = font_manager.FontProperties(fname=fontname).get_name() | |
plt.style.use('seaborn-white') | |
rc('font', family=fontname) |
반응형
'Programming > Python' 카테고리의 다른 글
[Python] Pandas Dataframe을 예쁘게 출력하는 방법 (0) | 2018.10.20 |
---|---|
[Python] Pandas csv를 dataframe으로 읽고 쓰는 방법 (0) | 2018.10.20 |
[Python] gzip.open, zcat & pipeline 성능비교 (0) | 2018.10.20 |
[Python] 튜블 정렬 하는 방법 (0) | 2018.10.20 |
[Python] 쥬피터(jupyter) 노트북 백그라운드로 실행 (0) | 2018.10.20 |