seaborn画热力图时行名中包括中文显示成方框
df该dataframe的行名是中文,可以加上下面代码中红色这句,就可以显示出中文import matplotlib.pyplot as pltimport seaborn as snssns.set(font="simhei")#遇到标签需要汉字的可以在绘图前加上这句f, ax = plt.subplots(figsize=(10,10))sns.heatmap(df, ...
·
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)
更多推荐



所有评论(0)