When [python error] use matplotlib drawing, Chinese can not be displayed on the picture

Problem Description

 In use python process, we often need to use matplotlib draw pictures in the drawing process, we sometimes need to display Chinese characters in the picture, during use, the problem can not display text will appear.

Solution

Add the following statement in the code can be solved:

from pylab import mpl
mpl.rcParams['font.sans-serif'] = ['SimHei']

reference

Pictures can not be displayed on the character issue

Published 98 original articles · won praise 0 · Views 2696

Guess you like

Origin blog.csdn.net/qq_22017379/article/details/104313414