Mac系统里面字体存储位置有两个:
xinaodeiMac:/ xinao$ cd /Library/Fonts
xinaodeiMac:Fonts xinao$ pwd
/Library/Fonts
xinaodeiMac:Fonts xinao$ ls -l
total 265280
-rw-r--r-- 1 root wheel 124996 7 31 2016 Al Nile.ttc
-rw-r--r-- 1 root wheel 76572 7 31 2016 Al Tarikh.ttc
-rw-r--r-- 1 root wheel 178720 7 31 2016 AlBayan.ttc
-rw-r--r-- 1 root wheel 2410616 2 1 2017 AmericanTypewriter.ttc
-rw-r--r-- 1 root wheel 109700 2 1 2017 Andale Mono.ttf
-rw-r--r-- 1 root wheel 335572 2 1 2017 Apple Chancery.ttf
xinaodeiMac:Fonts xinao$ cd /System/Library/Fonts
xinaodeiMac:Fonts xinao$ pwd
/System/Library/Fonts
xinaodeiMac:Fonts xinao$ ls
Apple Braille Outline 6 Dot.ttf
Apple Braille Outline 8 Dot.ttf
Apple Braille Pinpoint 6 Dot.ttf
Apple Braille Pinpoint 8 Dot.ttf
按照书上的说法,进行下面两步骤即可解决中文显示问题:
第一步:把STHeiti.ttf字体放到matplotlib的mpl-data/fonts/ttf目录下:
/usr/local/lib/python3.7/sit