简体   繁体   English

带有 48 个变量的 Seaborn 热图

[英]Seaborn heatmap with 48 variables

I have a dataset for which I have filtered down my the possible attributes to be used for model building , they are still coming out to be 48 variables.我有一个数据集,我已经过滤掉了用于模型构建的可能属性,它们仍然是 48 个变量。 When I try to draw a corelation map using seaborn heatmap , the values are overwritten and not clear.当我尝试使用 seaborn heatmap 绘制相关图时,这些值被覆盖且不清楚。 在此处输入图片说明

Code used使用的代码

    cor = train[cols].corr()
    #fig,ax = plt.subplots()
    sns.heatmap(cor,annot=True)
    plt.show()

How can I make this readable ,have tried figsize but still not working.我怎样才能使这个可读,已经尝试了 figsize 但仍然无法正常工作。 I am using Pycharm我正在使用 Pycharm

You can change the fontsize of the annotation by passing annot_kws to the function:您可以通过将annot_kws传递给函数来更改注释的字体annot_kws

sns.heatmap(np.arange(100).reshape(10,10), annot=True)

在此处输入图片说明

sns.heatmap(np.arange(100).reshape(10,10), annot=True, annot_kws={'fontsize':5})

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM