1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| for i in range(len(D)):
x = []
y = []
labels = []
titles = D[i][0][0]
for iat in range(1,len(D[i])):
labels.append(D[i][iat][0])
x.append(D[i][iat][1])
y.append(D[i][iat][2])
ax = plt.subplot()
rects = ax.bar(x,y,width = 0.1, color = 'b', align = 'center', alpha = 0.5)
ax.set_ylabel('Coord')
ax.set_xlabel('Dist')
patch = matplotlib.patches.Patch(color = 'b', label = titles)
plt.legend(handles=[patch])
ax.set_title(Name)
ax.set_xticks(x)
ax.set_xticklabels([i for i in x] , rotation='vertical')
rects = ax.patches
for rect,label in zip(rects,labels):
height = rect.get_height()
ax.text(rect.get_x() + rect.get_width()/2., height + 0.1 ,label, ha ='center', va ='bottom')
plt.show()
width = 0.4
xlocations = np.array(range(len(occ)))+0.5
bar(xlocations, ocu, width, color ='b', align = 'center', alpha = 0.5)
xticks(xlocations + width/2, natom)
title("occ")
show() |
Partager