To repress the scientific notation, use style="plain" in ticklabel_format() method.
The annot only help to add numeric value on python heatmap cell but fmt parameter allows to add string (text) values on the cell. Here, we created a 2D numpy array which contains string values and passes to annot along with that pass a string value “s” to fmt.
According to the docs, the param fmt='.2g'
is being applied because you've set annot=True
so you can modify the format being applied to:
sns.heatmap(table2,annot=True,cmap='Blues', fmt='g')
According to the docs, the parameter fmt
is set to .2g
when annot=True
. So, for example, if your data is float
, you can use:
sns.heatmap(table2, annot=True, cmap='Blues', fmt='.3g')
By that, you're telling python to show 3 significant figures. To understand the "fmt" better, check out this answer: https://stackoverflow.com/a/65020192/4529605
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