Where have you asked?
Your code seems to work and is using rotated text labels:
x = np.random.uniform(0, 1, (10, 10))

fig, ax = plt.subplots()
im = ax.imshow(x, interpolation='nearest', cmap=plt.cm.Blues)
ax.figure.colorbar(im, ax=ax)

classes = ['label{}'.format(i) for i in range(10)]
title = 'confusion matrix'
# We want to show all ticks...
ax.set(xticks=np.arange(x.shape[1]),
       yticks=np.arange(x.shape[0]),
       # ... and label them with the respective list entries
       xticklabels=classes, yticklabels=classes,
       title=title,
       ylabel='True label',
       xlabel='Predicted label')

# Rotate the tick labels and set their alignment.
plt.setp(ax.get_xticklabels(), rotation=45, ha="right",
         rotation_mode="anchor")