I want the negative bars to be facing downwards, and the positive upwards, with the x-axis(0-line) passing right between them. I tried this
chart = fig.bar(x, ne
You don't need to add a twin axis, you can plot both bar charts on the same axis like this:
x = range(7)
negative_data = [-1,-4,-3,-2,-6,-2,-8]
positive_data = [4,2,3,1,4,6,7,]
fig = plt.figure()
ax = plt.subplot(111)
ax.bar(x, negative_data, width=1, color='r')
ax.bar(x, positive_data, width=1, color='b')
Bars with a width of one will fill the axes and will scale with the figure as it is resized.