seaborn画热力图时行名中包括中文显示成方框

df该dataframe的行名是中文,可以加上下面代码中红色这句,就可以显示出中文

import matplotlib.pyplot as plt

import seaborn as sns

sns.set(font="simhei")#遇到标签需要汉字的可以在绘图前加上这句

f, ax = plt.subplots(figsize=(10,10)) 

sns.heatmap(df, annot=False, ax=ax)

猜你喜欢

转载自blog.csdn.net/u_7890/article/details/89297714