4.4.3 Heatmap
The heatmap is a way of representing the data in a 2-dimensional form. The data values are represented as colors in the graph. The goal of the heatmap is to provide a colored visual summary of information.
1. Heatmap and Annotation
We will create a random dataset and a subplot. The left one is the default mode heatmap, the right one shows the annotation.
# Create a random dataset
data = np.random.rand(5, 10)f,axes = plt.subplots(1,2, figsize = (20,6))
sns.heatmap(data, ax=axes[0])
sns.heatmap(data, annot=True, ax=axes[1])
2. Horizontal Bar Heatmap
Meanwhile, we can change the color bar to horizontal.


3. Categorical Heatmap (in Triangle)

Last updated
Was this helpful?