How to remove x and y axis labels in a clustermap?

Viewed 9083

I am creating a plot based on a DataFrame:

cg = sns.clustermap(df_correlations.T)

The problem is that the x and y axis have unwanted labels in it which come from a hierarchical index. Thus I want to try and remove those labels e.g. like this:

ax = cg.fig.gca()
ax.set_xlabel('')
ax.set_ylabel('')

But this has no effect. How can I remove the labels on the x and y axis?

3 Answers

Turn off xticklabel, and yticklabel will address your problem.

sns.clustermap(df,yticklabels=False,xticklabels=False)

try plt.axis('off'), it may solve your problem.

Related