matplotlib 전역 글꼴을 Times New Roman으로 변경
1. 코드 가입:
import matplotlib.pyplot as plt
plt.rc('font',family='Times New Roman')
2. 잘못 보고하면:
UserWarning: findfont: Font family [u'Times New Roman'] not found. Falling back to DejaVu Sans (prop.get_family(), self.defaultFamily[fontext]))
3. 설치:
sudo apt install msttcorefonts -qq
Ubuntu 16.04 오류 발생
E: Failed to fetch https://nchc.dl.sourceforge.net/project/corefonts/the fonts/final/andale32.exe Protocol "http" not supported or disabled in libcurl
4. 솔루션:
글꼴 라이브러리 수동 다운로드
proxychains wget http://downloads.sourceforge.net/corefonts/{andale32.exe,arial32.exe,arialb32.exe,comic32.exe,courie32.exe,georgi32.exe,impact32.exe,times32.exe,trebuc32.exe,verdan32.exe,webdin32.exe}
(wget이 디렉터리를 지정하지 않으면 터미널 현재 디렉터리로 다운로드됩니다.)
제거
ttf-mscorefonts-installer
:sudo apt remove --purge ttf-mscorefonts-installer
sudo apt autoremove ttf-mscorefonts-installer
그런 다음 설치를 계속합니다.
sudo apt-get install ttf-mscorefonts-installer
# ( )
sudo dpkg-reconfigure ttf-mscorefonts-installer
두 번째 줄 명령은 알림
wget
에 따라 다운로드한 글꼴 파일의 디렉터리를 입력하고 Tab
키OK
를 누르면 두 번째 줄 명령을 다시 입력할 수 있음을 알릴 수 있습니다. 다시 실행하면 됩니다~5. 마지막 단계(매우 관건!)
rm ~/.cache/matplotlib -rf
6. msttcorefonts 설치 문제:
Tab
키를 눌러 ok
를 선택하여 설치를 계속합니다.참조:
https://bugs.launchpad.net/ubuntu/+source/msttcorefonts/+bug/1607535 https://askubuntu.com/questions/543673/mscorefonts-problems
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.