I'd like to customize my seaborn heatmap
plot, by adding an extra bar on the y-axis that would illustrate the label of my indices.
Here is a toy example to illustrate my need:
test = pd.DataFrame.from_dict({"A": [np.random.randint(10) for _ in range(10)],
"B": [np.random.randint(10) for _ in range(10)],
})
sns.heatmap(test)
Let's say I have labels for each one of the Pandas indices like:
labels = ["class1", "class1", "class1", "class1", "class1", "class2", "class2", "class3", "class3", "class3"]
I'd like to add to the heatmap a bar on the y-axis with one color per label.
Thank you very much for your help !
PS: I saw this cool answer for seaborn.clustermap
How to express classes on the axis of a heatmap in Seaborn
But I don't think I directly applies to seaborn.heatmap