How to remove gaps between bars in Matplotlib bar chart

前端 未结 1 1531
后悔当初
后悔当初 2020-12-09 15:59

I\'m making a bar chart in Matplotlib with a call like this:

xs.bar(bar_lefts, bar_heights, facecolor=\'black\', edgecolor=\'black\')

I get

相关标签:
1条回答
  • 2020-12-09 16:58

    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.

    0 讨论(0)
提交回复
热议问题