Issue
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 a barchart that looks like this:
What I'd like is one with no white gap between consecutive bars, e.g. more like this:
Is there a way to achieve this in Matplotlib using the bar()
function?
Solution
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.
Answered By - George
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.