heatmap choos format for annotation 1

heatmap choos format for annotation

import numpy as np; np.random.seed(0)
import seaborn as sns; sns.set()
uniform_data = np.random.rand(6, 6)/100
ax = sns.heatmap(uniform_data,annot=True, fmt=".2%")

Here is what the above code is Doing:
1. We’re creating a random array of data with 6 rows and 6 columns.
2. We’re using the seaborn library to create a heatmap.
3. We’re using the annot=True parameter to show the values in each cell.
4. We’re using the fmt=”.2%” parameter to show the values as percentages.

Similar Posts