How to remove gaps between bars in Matplotlib bar chart

Add width=1.0 as a keyword argument to bar(). E.g.

xs.bar(bar_lefts, bar_heights, width=1.0, facecolor="black", edgecolor="black").

This will fill the bars gaps vertically.

Leave a Comment