Edit the width of bars using dataframe.plot() function in matplotlib

Osmond Bishop picture Osmond Bishop · Feb 12, 2013 · Viewed 34.1k times · Source

I am making a stacked bar plot using:

DataFrame.plot(kind='bar',stacked=True)

I want to control width of bars so that the bars are connected to each other like a histogram.

I've looked through the documentation but to no avail - any suggestions? Is it possible to do it this way?

Answer

Murkbeard picture Murkbeard · Dec 5, 2014

For anyone coming across this question:

Since pandas 0.14, plotting with bars has a 'width' command: https://github.com/pydata/pandas/pull/6644

The example above can now be solved simply by using

df.plot(kind='bar', stacked=True, width=1)