How do I increase the space between each bar with matplotlib barcharts, as they keep cramming them self to the centre. (this is what it currently looks)
impo
There are 2 ways to increase the space between the bars For reference here is the plot functions
plt.bar(x, height, width=0.8, bottom=None, *, align='center', data=None, **kwargs)
The plot function has a width parameter that controls the width of the bar. If you decrease the width the space between the bars will automatically reduce. Width for you is set to 0.8 by default.
width = 0.5
If you want to keep the width constant you will have to space out where the bars are placed on x-axis. You can use any scaling parameter. For example
x = (range(len(my_dict)))
new_x = [2*i for i in x]
# you might have to increase the size of the figure
plt.figure(figsize=(20, 3)) # width:10, height:8
plt.bar(new_x, my_dict.values(), align='center', width=0.8)