This question seems more matplotlib-related so, you might generally get a faster and better answer in their discussion boards or e.g. StackOverflow.
That being said, you can use ax.set_xticklabels(labels) to set the labels for an axis.
Based on your code snippet, I guess you might need to modify xticklabels=classes, yticklabels=classes.