How do I remove the x axis spacing between bars in a bar chart?

Viewed 3759

After changing the width to make the bars smaller, it has moved off to the sides. How do I remove the the spacing between them. Ideally, I want to center in the middle, but there seems to be no parameters in the documentation to set for it. Scaling the picture manually doesn't reduce this gap either.

import numpy as np
import matplotlib.pyplot as plt

objects = ('bar1', 'bar2')
y_pos = np.arange(len(objects))
performance = [2,6] 
stds=[0.3,0.5]
plt.bar(y_pos, performance, 0.3, align='center', yerr=stds,capsize=5, alpha=0.5)
plt.xticks(y_pos, objects)
plt.ylabel('Time (seconds)')
plt.show()

enter image description here

1 Answers
Related