I am trying to build a histogram in python matplot lib

Code:

def histogram(value_array,xlabel):


    mu, sigma = np.mean(value_array), np.std(value_array)
    n, bins, patches = plt.hist(value_array, 50, normed=1, 
                facecolor='blue',histtype = "bar", alpha=0.75)
    # add a 'best fit' line
    y = mlab.normpdf( bins, mu, sigma)
    l = plt.plot(bins, y, linewidth=1)
    plt.axis([np.min(value_array), np.max(value_array), np.min(y),np.max(y)])
    plt.grid(False)
    plt.xlabel(xlabel)
    plt.ylabel("pdf")
    plt.show()

Output:

enter image description here The scale of the values in the x-axis should either be in the middle of the bar or starting point of the bar. I am not able to understand why it is mis aligned like this. Anyone has faced this issue?