이 예에서와 같이 별도의 눈금 라벨 '수준으로'\ n '을 사용하십시오 :
import numpy as np
import matplotlib.pyplot as plt
ind = np.arange(3)
width = .2
x = list()
# x labels position: i = 1st bar, i+w/2 = category, i+w = 2nd bar
for i in ind:
x.extend([i, i+width/2., i+width])
# plot bars
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')
# set ticks and labels
plt.xticks(x)
ax.set_xticklabels(('A1','\n\nGeneral Info', 'A2', 'B1','\n\nTechnical', 'B2', 'C1','\n\nPsycological', 'C2'),ha='center')
# hide tick lines for x axis
ax.tick_params(axis='x', which='both',length=0)
# rotate labels with A
for label in ax.get_xmajorticklabels():
if 'A' in label.get_text(): label.set_rotation(45)
plt.show()

당신이 작성한 줄거리에 대한 코드를 제공 할 수 지금까지? – Kewl
나는 ax.text()를 사용하는 것이 최선의 선택 인 것을 두려워한다. 그런 다음 막대의 위치를 사용하여 텍스트를 잘 정렬 할 수 있습니다. – ImportanceOfBeingErnest