import numpy as np import matplotlib.pyplot as plt barWidth=5 data=np.array([(weights/100),(LCGs/100)],dtype=[('weights',float),('LCGs',float)]).T sorted_data = np.sort(data,order="LCGs") plt.bar(sorted_data[:,0].astype(float),sorted_data[:,1].astype(float), barWidth, color='r') plt.axis([(1.05*max(LCGs/100)), min(-0.05*(max(LCGs/100)-min(LCGs/100)),min(LCGs/100)), min(weights/100), (1.05*max(weights/100))]) plt.show()