python matplot seaborn 中文错误

282 阅读1分钟

导入matplotlib和seanborn包

import matplotlib.pyplot as plt
import seaborn as sns

设置中文字体和负号

plt.rcParams['font.family'] = ['Arial Unicode MS'] #用来
plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号
sns.set_style('whitegrid',{'font.sans-serif':['Arial Unicode MS','Arial']})