Use '\ n' to separate label shortcut levels, as in this example:
import numpy as np
import matplotlib.pyplot as plt
ind = np.arange(3)
width = .2
x = list()
for i in ind:
x.extend([i, i+width/2., i+width])
fig = plt.figure()
ax = fig.add_subplot(111)
rects1 = ax.bar(ind, [1, 3, 5], width, color='r', align = 'center')
rects2 = ax.bar(ind+width, [2, 4, 6], width, color='g', align = 'center')
plt.xticks(x)
ax.set_xticklabels(('A1','\n\nGeneral Info', 'A2', 'B1','\n\nTechnical', 'B2', 'C1','\n\nPsycological', 'C2'),ha='center')
ax.tick_params(axis='x', which='both',length=0)
for label in ax.get_xmajorticklabels():
if 'A' in label.get_text(): label.set_rotation(45)
plt.show()

source
share