Skip to content
Advertisement

How to provide axis for seaborn clustermap

I want to provide the plot axes for a seaborn clustermap. The docs say that additional arguments are passed to the heatmap function. The docs of the heatmap function mention the keyword argument ax. Which is why I call the clustermap function with the keyword argmument ax=plt.gca(). However this will result in the following error:

JavaScript

Thus I was wondering how to correctly pass the axis argument to the clustermap function?

Below is a minimal example to reproduce the error.

JavaScript

PS.: Without the additional ax argument the plot works fine.

Advertisement

Answer

This is not possible as seaborn.clustermap is a figure level plotting function. There is one axes for the heat map and one for each tree.

What exactly would you like to achieve? You can always create your clustermap first and then modify it to add other axes.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement