seaborn中文乱码问题解决

试了好多方法,亲测这个Mac+Anaconda下有效。

1
2
3
4
5
6
7
8
9
10
11
12
13
import seaborn as sns 
import matplotlib.pyplot as plt
import pandas as pd

%matplotlib inline

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']})