If anyone wonders how to this for clustermap CorrGrids (part of a given seaborn example):
import seaborn as sns import matplotlib.pyplot as plt sns.set(context="paper", font="monospace") # Load the datset of correlations between cortical brain networks df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0) corrmat = df.corr() # Set up the matplotlib figure f, ax = plt.subplots(figsize=(12, 9)) # Draw the heatmap using seaborn g=sns.clustermap(corrmat, vmax=.8, square=True) rotation = 90 for i, ax in enumerate(g.fig.axes): ## getting all axes of the fig object ax.set_xticklabels(ax.get_xticklabels(), rotation = rotation) g.fig.show()
seaborn.objectswith v0.12, see How to rotate the xticks with seaborn.objects