user308827
user308827

Reputation: 21961

Aligning bar charts in matplotlib

In the attached graph, I am using ax.bar() to construct the bars and would like them to align with the 2012, 2013 etc. values below them. Is there a way to specify horizontal separation between bars in matplotlib?

please note that the 2012, 2013.. labels are coming from the calendar plot

enter image description here

Upvotes: 1

Views: 762

Answers (1)

NotaGoodProgrammer
NotaGoodProgrammer

Reputation: 61

Without seeing your code, my best advice is to use multiplication to set everything a standard distance from everything else. It is how I would set the distance of the bar graphs in python Idle.

You would be wise to use the same multiplication for the dates as well. Like date1 * 3(insert distance from left margine.) Then date2 * 3(insert distance from date1).

or if you are loading all of the dates with one line of code, you should be able to handle their distance by formating the justifications. This might also work for the bar graphs if you are creating them along with the dates.

Upvotes: 2

Related Questions