Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- working directory
- Selenium
- props
- ruby
- ec2
- vue
- php
- dockerfile
- centOS7
- AWS
- controller
- laravel
- staging area
- cron
- docker-compose
- imagemagick
- MySQL
- NGINX
- Wordpress
- linux
- Git
- javascript
- docker
- ubuntu
- codeigniter4
- react
- pagination
- SQL
- Python
- Ruby On Rails
Archives
- Today
- Total
내가 한 노력들
[ ubuntu ] 일본어 폰트 패키지 설치 && matplotlib에 적용 본문
takao 폰트 설치
sudo apt install fonts-takao
폰트 확인
ls -al /usr/share/fonts/truetype
ubuntu의 공용 font 경로를 확인해보면 takao 폰트가 설치된 것을 확인할 수 있습니다.
폰트 캐시 삭제
fc-cache -fv
폰트 배포
matplotlib 설정 디렉토리 위치를 파악해야합니다.
python3
>>> import matplotlib
>>> matplotlib.__file__
#결과
/usr/local/lib/python3.8/dist-packages/matplotlib/__init__.py
폰트 배포는 matplotlib 디렉토리 경로 + mpl-data/fonts/ttf에 위치하게 됩니다.
cp /usr/share/fonts/truetype/takao-mincho/Takao* /usr/local/lib/python3.8/dist-packages/matplotlib/mpl-data/fonts/ttf/
ubuntu에 설치한 폰트를 matplotlib의 폰트 디렉토리에 복사해줍니다.
Matplotlib 폰트 캐시 삭제
rm -rf ~/.cache/matplotlib/*
폰트 적용
import matplotlib
matplotlib.rcParams['font.family'] = 'TakaoMincho'
matplotlib.rcParams['font.size'] = 15
matplotlib.rcParams['axes.unicode_minus'] = False
일본어 폰트가 적용된 그래프를 확인해보면, 글자가 깨지는 것 없이 잘 저장된 것을 확인할 수 있습니다.
참고블로그
'IT 공부 > Linux' 카테고리의 다른 글
[ Linux ] Cron 사용해서, 일정시간마다 스크립트 실행시키기! (0) | 2022.01.27 |
---|---|
[ Linux ] linux환경에서 selenium 사용하기 (ubuntu/centos) (0) | 2022.01.26 |
Centos 환경에서 Nginx 서버 구동하기 (0) | 2021.10.05 |
[ Linux ] Shell Script(4) and Cron(scheduler) (0) | 2021.06.04 |
[ Linux ] Shell script (3) (0) | 2021.06.03 |