python + mac + matplotlib Chinese garbled perfect solution, absolutely simple

  It is a method of online search, all too much trouble, in fact, as long as these two steps can be easily resolved

1. Edit the file in the matplotlib, cancel font.famliy, before font.sans-serif #

vim /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc

  

 

2. Rebuild the font environment

from matplotlib.font_manager import _rebuild
_rebuild()

  Get!

 

Guess you like

Origin www.cnblogs.com/cauwt/p/python_mac_matplotlib_font_cn.html