I have a conceptual problem in the basic structure of matplotlib. I want to add a Caption to a graph and I do understand the advice given in Is there a way of drawing a caption box in matplotlib However, I do not know, how to combine this with the pandas data frame I have. Without the structure given in the link above my code looks (projects1 being my pandas data frame):
ax2=projects1.T.plot.bar(stacked=True)
ax2.set_xlabel('Year',size=20)
and it returns a barplot. But if I want to apply the structure of above, I get stuck. I tried:
fig = plt.figure()
ax2 = fig.add_axes((.1,.4,.8,.5))
ax2.plot.bar(projects1.T,stacked=True)
And it results in various errors. So the question is, how do I apply the structure of the link given above with pandas data frame and with more complex graphs than a mere line. Thx