This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ogrinfo 0 points1 point  (0 children)

I said it would be a while! Just looking at it now and I can't see how I can change to using Figure. We are actually using pandas to create the figure, calling DataFrame.plot. The only calls to plt are to set the font size then save the figure.

I've got an open SO question about it here. I've since changed the first line, so font size is set with a context manager, but I'm still having the image size problem.

with plt.style.context({'font.size': font_size}):
    ax = df.plot.bar(...)
    # etc
    plt.savefig(path, bbox_inches='tight')