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=corrmat.values.min(), vmax=1, square=True, cmap="YlGnBu", linewidths=0.1, annot=True, annot_kws={"size":8})
here the size is set in "annot_kws".
Consider calling sns. set(font_scale=1.4) before plotting your data. This will scale all fonts in your legend and on the axes. Of course, adjust the scaling to whatever you feel is a good setting.
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})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With