So, basically what I want is to reduce the distance between two bars, but all the solutions that I read on the internet were people changing the width of the bars, and that is not what I want.
This is my chart:
x = ['Goal (95%)','Achieved (100%)']
y = [95,100]
plt.bar(x,y,color = ('darkcyan','green'), width = 0.2)
plt.ylabel('Percentage (%)')
I expect something like this:
If I change the width I can reduce the distance, but the bars get very thick and I want them thin.
plt.bar(x,y,color = ('darkcyan','green'), width = 0.8)
plt.ylabel('Percentage (%)')
I got something closely approximating what you want working by changing the figure size and then updating the width.
plt.figure(figsize=(3,4))
plt.bar(x,y,color = ('darkcyan','green'), width = 0.8)
Usually when you scale the figure size down the bars just get more narrow, so combining that with thicker bars seemed to do the trick. You can play with the numbers a little to get it exactly how you want it.