Skip to content Skip to sidebar Skip to footer

Chart Barh Matplotlib - Overlap Bars

I'm new user of matplotlib and I have a problem with chart barh: overlap bars. When plot the graph, the bars draws overlapped and I haven't found the reason. In my opinion the pro

Solution 1:

I think you are mis-understanding the meaning of height (doc). The units are in axis units, not pixels.

heightColumn = height*1.0 / (rdata) / (len(columns))
heightColumn = heightColumn/dpi

to

height_of_group = .9heightColumn = height_of_group / (len(data))
#heightColumn = heightColumn/dpi

will get non-overlapping bars with just a bit of extra space between the groups. You can adjust the space between the groups by making height_of_group larger or smaller so long as it is less than 1.

Post a Comment for "Chart Barh Matplotlib - Overlap Bars"