Auto adjust font size in seaborn heatmap

前端 未结 4 2093
一向
一向 2020-12-07 00:40

when using seaborn heatmap, is there a way to auto-adjust the font size for it to fit exactly inside the squares? for example in:

sns.heatmap(corrmat, vmin=         


        
4条回答
  •  半阙折子戏
    2020-12-07 01:00

    You can also do:

    sns.heatmap(corrmat, vmin=corrmat.values.min(), vmax=1, square=True, cmap="YlGnBu", linewidths=0.1, annot=True, annot_kws={"fontsize":8})  
    

提交回复
热议问题