import matplotlib.pyplot as plt
import numpy as np
index = np.arange(5)
values1 = [5,7,3,4,6]
std1 = [0.8,1,0.4,0.9,1.3]
plt.title('A Bar Chart')
plt.barh(index,values1,xerr=std1,error_kw={'ecolor':'0.8','capsize':6},alpha=0.7,label='First')
#plt.barh(水平条状图)
plt.xticks(index+0.4,['A','B','C','D','E'])
plt.legend(loc=5)
plt.show()